open-index/open-npm huggingface dataset:
npm package: @haathie/postgraphile-otel
Description: OpenTelemetry plugin for PostGraphile
Latest version: 0.1.0

# Postgraphile OTEL Plugin

OpenTelemetry plugin for PostGraphile, providing tracing capabilities for GraphQL requests. This plugin traces:
- Errors in GraphQL requests
- Operation Planning
- Step Execution

## Installation & Usage

Install:
```bash
npm i @haathie/postgraphile-otel
```

Add to your PostGraphile config:
```ts
import { OTELPlugin } from '@haathie/postgraphile-otel';

const preset: GraphileConfig.Preset = {
	...otherOptions,
	plugins: [
		OTELPlugin,
		...otherPlugins,
	],
}
```

Of course, this assumes you have OpenTelemetry set up in your application. If you don't, you can refer to the [OpenTelemetry documentation](https://opentelemetry.io/docs/languages/js/getting-started/nodejs/) for guidance on how to set it up.
For reference, you can refer to our [example application's tracing](../contacts-example/src/tracing.ts)

An example trace looks like this in Jaeger:
![Example Trace](./images/example-trace.png)
npm package: @haathie/postgraphile-reasonable-limits
Description: This plugin automatically applies reasonable, configurable limits to the number of records that can be requested in a single query. It is designed to prevent excessive data retrieval that could lead to performance issues.
Latest version: 0.2.0

# Reasonable Limits Plugin for PostGraphile

This plugin automatically applies reasonable, configurable limits to the number of records that can be requested in a single query. It is designed to prevent excessive data retrieval that could lead to performance issues.

## Installation

```sh
npm i @haathie/postgraphile-reasonable-limits
```

## Usage

Just add the plugin to your PostGraphile setup:

```js
import { ReasonableLimitsPlugin } from '@haathie/postgraphile-reasonable-limits';

export const preset = {
	plugins: [
		ReasonableLimitsPlugin
	]
}
```

By default, all connections will have a limit of `100` records per query. By default only `10` records will be returned.

To customize the limits, you can add smart tags to the table/function.

```sql
COMMENT ON TABLE your_schema.your_table IS $$
@maxRecordsPerPage 200
@defaultRecordsPerPage 50
$$;
```

Other things to keep in mind:
- If you set `first` to `null` without setting `last`, an error will be thrown, and vice versa.
- To fetch the `last` `N` records, please set `first` to `null` too in the request. See this [issue](https://github.com/graphile/crystal/issues/2773#issuecomment-3394119865).

## Debugging

To debug whether the limit is correctly applied to a "connection" of yours, you can use the `DEBUG` env var:
```
DEBUG=@haathie/postgraphile-reasonable-limits:log
```
npm package: @haathie/postgraphile-replace-types
Description: This plugin allows you to replace fields in the GraphQL schema with custom types. This is useful for cases where you want to change the behavior of a field without changing the underlying database schema.
Latest version: 0.1.1

# Replace Types

This plugin allows you to replace fields in the GraphQL schema with custom types.
This is useful for cases where you want to change the behavior of a field without changing the underlying database schema.

## Usage

To use this plugin, you need to install it and then add it to your PostGraphile configuration.

```
npm i @haathie/postgraphile-replace-types
```

Add to your preset's plugins:
```ts
import { ReplaceTypesPlugin } from '@haathie/postgraphile-replace-types';
const preset = {
	...otherStuff,
	plugins: [
		...otherPlugins,
		extendSchema(() => {
			return {
				typeDefs: `
					enum NewTypeName {
						VALUE1
					}
				`,
				enums: {
					NewTypeName: {
						values: {
							VALUE1: 'VALUE1',
						}
					},
				}
			}
		})
		ReplaceTypesPlugin,
	],
}
```

## Replacing a Field

Add a smart comment tag to the column in the database:
```sql
COMMENT ON COLUMN table_name.field_name IS '@replaceType NewTypeName';
```

For input types, it will first try `NewTypeNameInput`, then fall back to `NewTypeName`.