Socket
Socket
Sign inDemoInstall

graphile-build

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphile-build - npm Package Compare versions

Comparing version 5.0.0-beta.11 to 5.0.0-beta.12

29

CHANGELOG.md
# graphile-build
## 5.0.0-beta.12
### Patch Changes
- [#1877](https://github.com/graphile/crystal/pull/1877)
[`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f)
Thanks [@benjie](https://github.com/benjie)! - Move 'declare global' out of
'interfaces.ts' and into 'index.ts' or equivalent. Should make TypeScript more
aware of these types.
- [#1817](https://github.com/graphile/crystal/pull/1817)
[`f66cc40b3`](https://github.com/graphile/crystal/commit/f66cc40b3bc5bf2e7f92fe5a6bd5638e2a51ac2b)
Thanks [@benjie](https://github.com/benjie)! - Enable detecting "empty" enums
(enums with no values).
- [#1878](https://github.com/graphile/crystal/pull/1878)
[`f18635a5c`](https://github.com/graphile/crystal/commit/f18635a5cf55845c9534d82bb483e5fbb9ed179e)
Thanks [@benjie](https://github.com/benjie)! - Export
getNodeIdHandlerByTypeName to make writing plugins easier
- Updated dependencies
[[`3fdc2bce4`](https://github.com/graphile/crystal/commit/3fdc2bce42418773f808c5b8309dfb361cd95ce9),
[`aeef362b5`](https://github.com/graphile/crystal/commit/aeef362b5744816f01e4a6f714bbd77f92332bc5),
[`8a76db07f`](https://github.com/graphile/crystal/commit/8a76db07f4c110cecc6225504f9a05ccbcbc7b92),
[`8a0cdb95f`](https://github.com/graphile/crystal/commit/8a0cdb95f200b28b0ea1ab5caa12b23dce5f374f),
[`1c9f1c0ed`](https://github.com/graphile/crystal/commit/1c9f1c0edf4e621a5b6345d3a41527a18143c6ae)]:
- grafast@0.1.1-beta.2
- graphile-config@0.0.1-beta.5
## 5.0.0-beta.11

@@ -4,0 +33,0 @@

217

dist/index.d.ts
import "./global.js";
import "./interfaces.js";
import type { GraphQLSchema } from "grafast/graphql";
import { AddNodeInterfaceToSuitableTypesPlugin, BuiltinScalarConnectionsPlugin, ClientMutationIdDescriptionPlugin, CommonTypesPlugin, CursorTypePlugin, MutationPayloadQueryPlugin, MutationPlugin, NodeAccessorPlugin, NodeIdCodecBase64JSONPlugin, NodeIdCodecPipeStringPlugin, NodePlugin, PageInfoStartEndCursorPlugin, QueryPlugin, QueryQueryPlugin, RegisterQueryNodePlugin, StreamDeferPlugin, SubscriptionPlugin, SwallowErrorsPlugin, TrimEmptyDescriptionsPlugin } from "./plugins/index.js";
import SchemaBuilder from "./SchemaBuilder.js";
export { camelCase, constantCase, constantCaseAll, EXPORTABLE, formatInsideUnderscores, gatherConfig, pluralize, singularize, upperCamelCase, upperFirst, } from "./utils.js";
import type { GrafastArgumentConfig, GrafastFieldConfig, GrafastFieldConfigArgumentMap, PromiseOrDirect } from "grafast";
import type { GraphQLArgumentConfig, GraphQLEnumTypeConfig, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLScalarTypeConfig, GraphQLSchema, GraphQLSchemaConfig } from "grafast/graphql";
import type { PluginHook } from "graphile-config";
import type { GatherPluginContext } from "./interfaces.js";
import type { NewWithHooksFunction } from "./newWithHooks/index.js";

@@ -69,2 +72,214 @@ export { GraphileBuild, GraphileConfig };

export { version } from "./version.js";
declare global {
namespace GraphileConfig {
interface Preset {
/**
* The inflection phase is the first phase that occurs when building a
* schema with Graphile Build. It is responsible for naming things - both
* things that are generated in the `gather` phase, and the ultimate
* types, fields, arguments, directives and so on in the GraphQL schema.
*/
inflection?: GraphileBuild.InflectionOptions;
/**
* The `gather` phase is the second phase that occurs when building a
* schema with Graphile Build. It is responsible for looking at
* everything that can influence the shape of your schema, and turning
* that into an "input" for the `schema` phase.
*/
gather?: GraphileBuild.GatherOptions;
/**
* The `schema` phase is the final phase that occurs when building a
* schema with Graphile Build. It is responsible for taking the inputs
* from the `gather` phase (and using the inflectors from the
* `inflection` phase) and generating a final GraphQL schema.
*/
schema?: GraphileBuild.SchemaOptions;
}
interface PluginInflectionConfig {
/**
* Define new inflectors here
*/
add?: {
[key in keyof GraphileBuild.Inflection]?: (this: GraphileBuild.Inflection, options: ResolvedPreset, ...args: Parameters<GraphileBuild.Inflection[key]>) => ReturnType<GraphileBuild.Inflection[key]>;
};
/**
* Overwrite existing inflectors here.
*/
replace?: {
[key in keyof GraphileBuild.Inflection]?: (this: GraphileBuild.Inflection, previous: GraphileBuild.Inflection[key] | undefined, options: ResolvedPreset, ...args: Parameters<GraphileBuild.Inflection[key]>) => ReturnType<GraphileBuild.Inflection[key]>;
};
/**
* If set and you attempt to replace a non-existent inflector of one of
* the given names, we won't warn you.
*/
ignoreReplaceIfNotExists?: Array<keyof GraphileBuild.Inflection>;
}
interface GatherHelpers {
}
interface GatherHooks {
}
interface PluginGatherConfig<TNamespace extends keyof GatherHelpers, TState extends {
[key: string]: any;
} = {
[key: string]: any;
}, TCache extends {
[key: string]: any;
} = {
[key: string]: any;
}> {
/**
* A unique namespace for this plugin to use.
*/
namespace?: TNamespace;
/**
* If this plugin supports a persistant internal state (aka a cache, this
* is an optimisation for watch mode), this returns the value to initialise
* this cache to.
*/
initialCache?: () => TCache;
/**
* The initial value to use for this plugin when a new gather run
* executes.
*/
initialState?: (cache: TCache) => PromiseOrDirect<TState>;
/**
* The plugin must register helpers to allow other plugins to access its
* internal state. (Just use an empty object if you don't need any.)
*/
helpers?: {
[key in keyof GatherHelpers[TNamespace]]: (info: GatherPluginContext<TState, TCache>, ...args: Parameters<GatherHelpers[TNamespace][key]>) => ReturnType<GatherHelpers[TNamespace][key]>;
};
hooks?: {
[key in keyof GatherHooks]?: PluginHook<GatherHooks[key] extends (...args: infer UArgs) => infer UResult ? (info: GatherPluginContext<TState, TCache>, ...args: UArgs) => UResult : never>;
};
/**
* Responsible for kicking off the data collection - ask for data from
* other plugins (or your own helpers), write data needed by the 'schema'
* phase to the 'output' object.
*/
main?: (output: Partial<GraphileBuild.BuildInput>, info: GatherPluginContext<TState, TCache>) => Promise<void>;
/**
* Called when the plugin is put into watch mode; the plugin should call
* the given callback whenever a change is detected, and should return a
* function that prevents this behaviour.
*/
watch?: (info: GatherPluginContext<TState, TCache>, callback: () => void) => PromiseOrDirect<() => void>;
}
interface Plugin {
inflection?: PluginInflectionConfig;
gather?: PluginGatherConfig<keyof GatherHelpers, any, any>;
schema?: {
globalBehavior?: string | ((behavior: string, build: GraphileBuild.Build) => string | string[]);
/**
* You should use `before`, `after` and `provides` to ensure that the entity
* behaviors apply in order. The order should be roughly:
*
* - `default` - default global behaviors like "update"
* - `inferred` - behaviors that are inferred based on the entity, e.g. a plugin might disable filtering _by default_ on a relation if it's unindexed
* - `override` - overrides set explicitly by the user
*/
entityBehavior?: {
[entityType in keyof GraphileBuild.BehaviorEntities]?: string | PluginHook<(behavior: string, entity: GraphileBuild.BehaviorEntities[entityType], build: GraphileBuild.Build) => string | string[]>;
};
hooks?: {
/**
* The build object represents the current schema build and is passed to all
* hooks, hook the 'build' event to extend this object. Note: you MUST NOT
* generate GraphQL objects during this phase.
*/
build?: PluginHook<GraphileBuild.Hook<Partial<GraphileBuild.Build> & GraphileBuild.BuildBase, GraphileBuild.ContextBuild, Partial<GraphileBuild.Build> & GraphileBuild.BuildBase>>;
/**
* The `init` phase runs after `build` is complete but before any types
* or the schema are actually built. It is the only phase in which you
* can register GraphQL types; do so using `build.registerType`.
*/
init?: PluginHook<GraphileBuild.Hook<Record<string, never>, GraphileBuild.ContextInit, GraphileBuild.Build>>;
/**
* 'finalize' phase is called once the schema is built; typically you
* shouldn't use this, but it's useful for interfacing with external
* libraries that mutate an already constructed schema.
*/
finalize?: PluginHook<GraphileBuild.Hook<GraphQLSchema, GraphileBuild.ContextFinalize, GraphileBuild.Build>>;
/**
* Add 'query', 'mutation' or 'subscription' types in this hook:
*/
GraphQLSchema?: PluginHook<GraphileBuild.Hook<GraphQLSchemaConfig, GraphileBuild.ContextSchema, GraphileBuild.Build>>;
/**
* Add any types that need registering (typically polymorphic types) here
*/
GraphQLSchema_types?: PluginHook<GraphileBuild.Hook<GraphQLNamedType[], GraphileBuild.ContextSchema, GraphileBuild.Build>>;
/**
* When creating a GraphQLObjectType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLObjectType' to add any root-level attributes, e.g. add a description
* - 'GraphQLObjectType_interfaces' to add additional interfaces to this object type
* - 'GraphQLObjectType_fields' to add additional fields to this object type (is
* ran asynchronously and gets a reference to the final GraphQL Object as
* `Self` in the context)
* - 'GraphQLObjectType_fields_field' to customize an individual field from above
* - 'GraphQLObjectType_fields_field_args' to add additional arguments to a field
* - 'GraphQLObjectType_fields_field_args_arg' to customize an individual argument from above
*/
GraphQLObjectType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastObjectTypeConfig<any, any>, GraphileBuild.ContextObject, GraphileBuild.Build>>;
GraphQLObjectType_interfaces?: PluginHook<GraphileBuild.Hook<GraphQLInterfaceType[], GraphileBuild.ContextObjectInterfaces, GraphileBuild.Build>>;
GraphQLObjectType_fields?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastFieldConfigMap<any, any>, GraphileBuild.ContextObjectFields, GraphileBuild.Build>>;
GraphQLObjectType_fields_field?: PluginHook<GraphileBuild.Hook<GrafastFieldConfig<any, any, any, any, any>, GraphileBuild.ContextObjectFieldsField, GraphileBuild.Build>>;
GraphQLObjectType_fields_field_args?: PluginHook<GraphileBuild.Hook<GrafastFieldConfigArgumentMap<any, any, any, any>, GraphileBuild.ContextObjectFieldsFieldArgs, GraphileBuild.Build>>;
GraphQLObjectType_fields_field_args_arg?: PluginHook<GraphileBuild.Hook<GrafastArgumentConfig<any, any, any, any, any, any>, GraphileBuild.ContextObjectFieldsFieldArgsArg, GraphileBuild.Build>>;
/**
* When creating a GraphQLInputObjectType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLInputObjectType' to add any root-level attributes, e.g. add a description
* - 'GraphQLInputObjectType_fields' to add additional fields to this object type (is
* ran asynchronously and gets a reference to the final GraphQL Object as
* `Self` in the context)
* - 'GraphQLInputObjectType_fields_field' to customize an individual field from above
*/
GraphQLInputObjectType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastInputObjectTypeConfig, GraphileBuild.ContextInputObject, GraphileBuild.Build>>;
GraphQLInputObjectType_fields?: PluginHook<GraphileBuild.Hook<GraphQLInputFieldConfigMap, GraphileBuild.ContextInputObjectFields, GraphileBuild.Build>>;
GraphQLInputObjectType_fields_field?: PluginHook<GraphileBuild.Hook<GraphQLInputFieldConfig, GraphileBuild.ContextInputObjectFieldsField, GraphileBuild.Build>>;
/**
* When creating a GraphQLEnumType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLEnumType' to add any root-level attributes, e.g. add a description
* - 'GraphQLEnumType_values' to add additional values
* - 'GraphQLEnumType_values_value' to change an individual value
*/
GraphQLEnumType?: PluginHook<GraphileBuild.Hook<GraphQLEnumTypeConfig, GraphileBuild.ContextEnum, GraphileBuild.Build>>;
GraphQLEnumType_values?: PluginHook<GraphileBuild.Hook<GraphQLEnumValueConfigMap, GraphileBuild.ContextEnumValues, GraphileBuild.Build>>;
GraphQLEnumType_values_value?: PluginHook<GraphileBuild.Hook<GraphQLEnumValueConfig, GraphileBuild.ContextEnumValuesValue, GraphileBuild.Build>>;
/**
* When creating a GraphQLUnionType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLUnionType' to add any root-level attributes, e.g. add a description
* - 'GraphQLUnionType_types' to add additional types to this union
*/
GraphQLUnionType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastUnionTypeConfig<any, any>, GraphileBuild.ContextUnion, GraphileBuild.Build>>;
GraphQLUnionType_types?: PluginHook<GraphileBuild.Hook<GraphQLObjectType[], GraphileBuild.ContextUnionTypes, GraphileBuild.Build>>;
/**
* When creating a GraphQLInterfaceType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLInterfaceType' to add any root-level attributes, e.g. add a description
* - 'GraphQLInterfaceType_fields' to add additional fields to this interface type (is
* ran asynchronously and gets a reference to the final GraphQL Interface as
* `Self` in the context)
* - 'GraphQLInterfaceType_fields_field' to customise an individual field from above
* - 'GraphQLInterfaceType_fields_field_args' to add additional arguments to a field
* - 'GraphQLInterfaceType_fields_field_args_arg' to customize an individual arguments from the above
*/
GraphQLInterfaceType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastInterfaceTypeConfig<any, any>, GraphileBuild.ContextInterface, GraphileBuild.Build>>;
GraphQLInterfaceType_fields?: PluginHook<GraphileBuild.Hook<GraphQLFieldConfigMap<any, any>, GraphileBuild.ContextInterfaceFields, GraphileBuild.Build>>;
GraphQLInterfaceType_fields_field?: PluginHook<GraphileBuild.Hook<GraphQLFieldConfig<any, any>, GraphileBuild.ContextInterfaceFieldsField, GraphileBuild.Build>>;
GraphQLInterfaceType_fields_field_args?: PluginHook<GraphileBuild.Hook<GraphQLFieldConfigArgumentMap, GraphileBuild.ContextInterfaceFieldsFieldArgs, GraphileBuild.Build>>;
GraphQLInterfaceType_fields_field_args_arg?: PluginHook<GraphileBuild.Hook<GraphQLArgumentConfig, GraphileBuild.ContextInterfaceFieldsFieldArgsArg, GraphileBuild.Build>>;
GraphQLInterfaceType_interfaces?: PluginHook<GraphileBuild.Hook<GraphQLInterfaceType[], GraphileBuild.ContextInterfaceInterfaces, GraphileBuild.Build>>;
/**
* For scalars
*/
GraphQLScalarType?: PluginHook<GraphileBuild.Hook<GraphQLScalarTypeConfig<any, any>, GraphileBuild.ContextScalar, GraphileBuild.Build>>;
};
};
}
}
}
//# sourceMappingURL=index.d.ts.map

216

dist/interfaces.d.ts

@@ -1,4 +0,2 @@

import type { GrafastArgumentConfig, GrafastFieldConfig, GrafastFieldConfigArgumentMap, PromiseOrDirect } from "grafast";
import type { GraphQLArgumentConfig, GraphQLEnumTypeConfig, GraphQLEnumValueConfig, GraphQLEnumValueConfigMap, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInterfaceType, GraphQLNamedType, GraphQLObjectType, GraphQLScalarTypeConfig, GraphQLSchema, GraphQLSchemaConfig } from "grafast/graphql";
import type { AsyncHooks, PluginHook } from "graphile-config";
import type { AsyncHooks } from "graphile-config";
/**

@@ -53,214 +51,2 @@ * The details in the 'info' object passed as the first argument to all gather

}
declare global {
namespace GraphileConfig {
interface Preset {
/**
* The inflection phase is the first phase that occurs when building a
* schema with Graphile Build. It is responsible for naming things - both
* things that are generated in the `gather` phase, and the ultimate
* types, fields, arguments, directives and so on in the GraphQL schema.
*/
inflection?: GraphileBuild.InflectionOptions;
/**
* The `gather` phase is the second phase that occurs when building a
* schema with Graphile Build. It is responsible for looking at
* everything that can influence the shape of your schema, and turning
* that into an "input" for the `schema` phase.
*/
gather?: GraphileBuild.GatherOptions;
/**
* The `schema` phase is the final phase that occurs when building a
* schema with Graphile Build. It is responsible for taking the inputs
* from the `gather` phase (and using the inflectors from the
* `inflection` phase) and generating a final GraphQL schema.
*/
schema?: GraphileBuild.SchemaOptions;
}
interface PluginInflectionConfig {
/**
* Define new inflectors here
*/
add?: {
[key in keyof GraphileBuild.Inflection]?: (this: GraphileBuild.Inflection, options: ResolvedPreset, ...args: Parameters<GraphileBuild.Inflection[key]>) => ReturnType<GraphileBuild.Inflection[key]>;
};
/**
* Overwrite existing inflectors here.
*/
replace?: {
[key in keyof GraphileBuild.Inflection]?: (this: GraphileBuild.Inflection, previous: GraphileBuild.Inflection[key] | undefined, options: ResolvedPreset, ...args: Parameters<GraphileBuild.Inflection[key]>) => ReturnType<GraphileBuild.Inflection[key]>;
};
/**
* If set and you attempt to replace a non-existent inflector of one of
* the given names, we won't warn you.
*/
ignoreReplaceIfNotExists?: Array<keyof GraphileBuild.Inflection>;
}
interface GatherHelpers {
}
interface GatherHooks {
}
interface PluginGatherConfig<TNamespace extends keyof GatherHelpers, TState extends {
[key: string]: any;
} = {
[key: string]: any;
}, TCache extends {
[key: string]: any;
} = {
[key: string]: any;
}> {
/**
* A unique namespace for this plugin to use.
*/
namespace?: TNamespace;
/**
* If this plugin supports a persistant internal state (aka a cache, this
* is an optimisation for watch mode), this returns the value to initialise
* this cache to.
*/
initialCache?: () => TCache;
/**
* The initial value to use for this plugin when a new gather run
* executes.
*/
initialState?: (cache: TCache) => PromiseOrDirect<TState>;
/**
* The plugin must register helpers to allow other plugins to access its
* internal state. (Just use an empty object if you don't need any.)
*/
helpers?: {
[key in keyof GatherHelpers[TNamespace]]: (info: GatherPluginContext<TState, TCache>, ...args: Parameters<GatherHelpers[TNamespace][key]>) => ReturnType<GatherHelpers[TNamespace][key]>;
};
hooks?: {
[key in keyof GatherHooks]?: PluginHook<GatherHooks[key] extends (...args: infer UArgs) => infer UResult ? (info: GatherPluginContext<TState, TCache>, ...args: UArgs) => UResult : never>;
};
/**
* Responsible for kicking off the data collection - ask for data from
* other plugins (or your own helpers), write data needed by the 'schema'
* phase to the 'output' object.
*/
main?: (output: Partial<GraphileBuild.BuildInput>, info: GatherPluginContext<TState, TCache>) => Promise<void>;
/**
* Called when the plugin is put into watch mode; the plugin should call
* the given callback whenever a change is detected, and should return a
* function that prevents this behaviour.
*/
watch?: (info: GatherPluginContext<TState, TCache>, callback: () => void) => PromiseOrDirect<() => void>;
}
interface Plugin {
inflection?: PluginInflectionConfig;
gather?: PluginGatherConfig<keyof GatherHelpers, any, any>;
schema?: {
globalBehavior?: string | ((behavior: string, build: GraphileBuild.Build) => string | string[]);
/**
* You should use `before`, `after` and `provides` to ensure that the entity
* behaviors apply in order. The order should be roughly:
*
* - `default` - default global behaviors like "update"
* - `inferred` - behaviors that are inferred based on the entity, e.g. a plugin might disable filtering _by default_ on a relation if it's unindexed
* - `override` - overrides set explicitly by the user
*/
entityBehavior?: {
[entityType in keyof GraphileBuild.BehaviorEntities]?: string | PluginHook<(behavior: string, entity: GraphileBuild.BehaviorEntities[entityType], build: GraphileBuild.Build) => string | string[]>;
};
hooks?: {
/**
* The build object represents the current schema build and is passed to all
* hooks, hook the 'build' event to extend this object. Note: you MUST NOT
* generate GraphQL objects during this phase.
*/
build?: PluginHook<GraphileBuild.Hook<Partial<GraphileBuild.Build> & GraphileBuild.BuildBase, GraphileBuild.ContextBuild, Partial<GraphileBuild.Build> & GraphileBuild.BuildBase>>;
/**
* The `init` phase runs after `build` is complete but before any types
* or the schema are actually built. It is the only phase in which you
* can register GraphQL types; do so using `build.registerType`.
*/
init?: PluginHook<GraphileBuild.Hook<Record<string, never>, GraphileBuild.ContextInit, GraphileBuild.Build>>;
/**
* 'finalize' phase is called once the schema is built; typically you
* shouldn't use this, but it's useful for interfacing with external
* libraries that mutate an already constructed schema.
*/
finalize?: PluginHook<GraphileBuild.Hook<GraphQLSchema, GraphileBuild.ContextFinalize, GraphileBuild.Build>>;
/**
* Add 'query', 'mutation' or 'subscription' types in this hook:
*/
GraphQLSchema?: PluginHook<GraphileBuild.Hook<GraphQLSchemaConfig, GraphileBuild.ContextSchema, GraphileBuild.Build>>;
/**
* Add any types that need registering (typically polymorphic types) here
*/
GraphQLSchema_types?: PluginHook<GraphileBuild.Hook<GraphQLNamedType[], GraphileBuild.ContextSchema, GraphileBuild.Build>>;
/**
* When creating a GraphQLObjectType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLObjectType' to add any root-level attributes, e.g. add a description
* - 'GraphQLObjectType_interfaces' to add additional interfaces to this object type
* - 'GraphQLObjectType_fields' to add additional fields to this object type (is
* ran asynchronously and gets a reference to the final GraphQL Object as
* `Self` in the context)
* - 'GraphQLObjectType_fields_field' to customize an individual field from above
* - 'GraphQLObjectType_fields_field_args' to add additional arguments to a field
* - 'GraphQLObjectType_fields_field_args_arg' to customize an individual argument from above
*/
GraphQLObjectType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastObjectTypeConfig<any, any>, GraphileBuild.ContextObject, GraphileBuild.Build>>;
GraphQLObjectType_interfaces?: PluginHook<GraphileBuild.Hook<GraphQLInterfaceType[], GraphileBuild.ContextObjectInterfaces, GraphileBuild.Build>>;
GraphQLObjectType_fields?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastFieldConfigMap<any, any>, GraphileBuild.ContextObjectFields, GraphileBuild.Build>>;
GraphQLObjectType_fields_field?: PluginHook<GraphileBuild.Hook<GrafastFieldConfig<any, any, any, any, any>, GraphileBuild.ContextObjectFieldsField, GraphileBuild.Build>>;
GraphQLObjectType_fields_field_args?: PluginHook<GraphileBuild.Hook<GrafastFieldConfigArgumentMap<any, any, any, any>, GraphileBuild.ContextObjectFieldsFieldArgs, GraphileBuild.Build>>;
GraphQLObjectType_fields_field_args_arg?: PluginHook<GraphileBuild.Hook<GrafastArgumentConfig<any, any, any, any, any, any>, GraphileBuild.ContextObjectFieldsFieldArgsArg, GraphileBuild.Build>>;
/**
* When creating a GraphQLInputObjectType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLInputObjectType' to add any root-level attributes, e.g. add a description
* - 'GraphQLInputObjectType_fields' to add additional fields to this object type (is
* ran asynchronously and gets a reference to the final GraphQL Object as
* `Self` in the context)
* - 'GraphQLInputObjectType_fields_field' to customize an individual field from above
*/
GraphQLInputObjectType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastInputObjectTypeConfig, GraphileBuild.ContextInputObject, GraphileBuild.Build>>;
GraphQLInputObjectType_fields?: PluginHook<GraphileBuild.Hook<GraphQLInputFieldConfigMap, GraphileBuild.ContextInputObjectFields, GraphileBuild.Build>>;
GraphQLInputObjectType_fields_field?: PluginHook<GraphileBuild.Hook<GraphQLInputFieldConfig, GraphileBuild.ContextInputObjectFieldsField, GraphileBuild.Build>>;
/**
* When creating a GraphQLEnumType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLEnumType' to add any root-level attributes, e.g. add a description
* - 'GraphQLEnumType_values' to add additional values
* - 'GraphQLEnumType_values_value' to change an individual value
*/
GraphQLEnumType?: PluginHook<GraphileBuild.Hook<GraphQLEnumTypeConfig, GraphileBuild.ContextEnum, GraphileBuild.Build>>;
GraphQLEnumType_values?: PluginHook<GraphileBuild.Hook<GraphQLEnumValueConfigMap, GraphileBuild.ContextEnumValues, GraphileBuild.Build>>;
GraphQLEnumType_values_value?: PluginHook<GraphileBuild.Hook<GraphQLEnumValueConfig, GraphileBuild.ContextEnumValuesValue, GraphileBuild.Build>>;
/**
* When creating a GraphQLUnionType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLUnionType' to add any root-level attributes, e.g. add a description
* - 'GraphQLUnionType_types' to add additional types to this union
*/
GraphQLUnionType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastUnionTypeConfig<any, any>, GraphileBuild.ContextUnion, GraphileBuild.Build>>;
GraphQLUnionType_types?: PluginHook<GraphileBuild.Hook<GraphQLObjectType[], GraphileBuild.ContextUnionTypes, GraphileBuild.Build>>;
/**
* When creating a GraphQLInterfaceType via `newWithHooks`, we'll
* execute, the following hooks:
* - 'GraphQLInterfaceType' to add any root-level attributes, e.g. add a description
* - 'GraphQLInterfaceType_fields' to add additional fields to this interface type (is
* ran asynchronously and gets a reference to the final GraphQL Interface as
* `Self` in the context)
* - 'GraphQLInterfaceType_fields_field' to customise an individual field from above
* - 'GraphQLInterfaceType_fields_field_args' to add additional arguments to a field
* - 'GraphQLInterfaceType_fields_field_args_arg' to customize an individual arguments from the above
*/
GraphQLInterfaceType?: PluginHook<GraphileBuild.Hook<GraphileBuild.GrafastInterfaceTypeConfig<any, any>, GraphileBuild.ContextInterface, GraphileBuild.Build>>;
GraphQLInterfaceType_fields?: PluginHook<GraphileBuild.Hook<GraphQLFieldConfigMap<any, any>, GraphileBuild.ContextInterfaceFields, GraphileBuild.Build>>;
GraphQLInterfaceType_fields_field?: PluginHook<GraphileBuild.Hook<GraphQLFieldConfig<any, any>, GraphileBuild.ContextInterfaceFieldsField, GraphileBuild.Build>>;
GraphQLInterfaceType_fields_field_args?: PluginHook<GraphileBuild.Hook<GraphQLFieldConfigArgumentMap, GraphileBuild.ContextInterfaceFieldsFieldArgs, GraphileBuild.Build>>;
GraphQLInterfaceType_fields_field_args_arg?: PluginHook<GraphileBuild.Hook<GraphQLArgumentConfig, GraphileBuild.ContextInterfaceFieldsFieldArgsArg, GraphileBuild.Build>>;
GraphQLInterfaceType_interfaces?: PluginHook<GraphileBuild.Hook<GraphQLInterfaceType[], GraphileBuild.ContextInterfaceInterfaces, GraphileBuild.Build>>;
/**
* For scalars
*/
GraphQLScalarType?: PluginHook<GraphileBuild.Hook<GraphQLScalarTypeConfig<any, any>, GraphileBuild.ContextScalar, GraphileBuild.Build>>;
};
};
}
}
}
//# sourceMappingURL=interfaces.d.ts.map

@@ -268,2 +268,9 @@ "use strict";

}
if (klass === graphql_1.GraphQLEnumType) {
// Perform values check.
if (Object.keys(type.getValues()).length === 0) {
allTypes[typeName] = null;
return null;
}
}
return type;

@@ -270,0 +277,0 @@ }

@@ -31,3 +31,6 @@ "use strict";

GraphQLObjectType_fields(fields, build, context) {
const { getTypeByName, inflection, [NodePlugin_js_1.NODE_ID_HANDLER_BY_TYPE_NAME]: nodeIdHandlerByTypeName, [NodePlugin_js_1.NODE_ID_CODECS]: nodeIdCodecs, graphql: { GraphQLNonNull, GraphQLID }, } = build;
const { getTypeByName, inflection,
// To get this in your own plugin, use
// `const nodeIdHandlerByTypeName = build.getNodeIdHandlerByTypeName();` instead
[NodePlugin_js_1.NODE_ID_HANDLER_BY_TYPE_NAME]: nodeIdHandlerByTypeName, [NodePlugin_js_1.NODE_ID_CODECS]: nodeIdCodecs, graphql: { GraphQLNonNull, GraphQLID }, } = build;
if (!nodeIdHandlerByTypeName) {

@@ -34,0 +37,0 @@ return fields;

@@ -20,2 +20,3 @@ import "graphile-config";

getNodeTypeNames?(): string[];
getNodeIdHandlerByTypeName?(): Readonly<Record<string, NodeIdHandler>>;
}

@@ -22,0 +23,0 @@ interface ScopeObjectFieldsField {

@@ -46,4 +46,9 @@ "use strict";

return build.extend(build, {
/** @internal */
[exports.NODE_ID_CODECS]: nodeIdCodecs,
/** @internal */
[exports.NODE_ID_HANDLER_BY_TYPE_NAME]: nodeIdHandlerByTypeName,
getNodeIdHandlerByTypeName() {
return nodeIdHandlerByTypeName;
},
registerNodeIdCodec(codec) {

@@ -106,3 +111,4 @@ const codecName = codec.name;

}
const { getTypeByName, extend, graphql: { GraphQLNonNull, GraphQLID }, inflection, [exports.NODE_ID_HANDLER_BY_TYPE_NAME]: nodeIdHandlerByTypeName, } = build;
const { getTypeByName, extend, graphql: { GraphQLNonNull, GraphQLID }, inflection, } = build;
const nodeIdHandlerByTypeName = build.getNodeIdHandlerByTypeName();
const nodeIdFieldName = build.inflection.nodeIdFieldName();

@@ -109,0 +115,0 @@ const nodeType = getTypeByName(inflection.builtin("Node"));

@@ -1,2 +0,2 @@

export declare const version = "5.0.0-beta.11";
export declare const version = "5.0.0-beta.12";
//# sourceMappingURL=version.d.ts.map

@@ -5,3 +5,3 @@ "use strict";

// This file is autogenerated by /scripts/postversion.mjs
exports.version = "5.0.0-beta.11";
exports.version = "5.0.0-beta.12";
//# sourceMappingURL=version.js.map
{
"name": "graphile-build",
"version": "5.0.0-beta.11",
"version": "5.0.0-beta.12",
"description": "Build a GraphQL schema from plugins",

@@ -44,3 +44,3 @@ "type": "commonjs",

"debug": "^4.3.4",
"graphile-config": "^0.0.1-beta.4",
"graphile-config": "^0.0.1-beta.5",
"graphql": "^16.1.0-experimental-stream-defer.6",

@@ -56,4 +56,4 @@ "lodash": "^4.17.21",

"peerDependencies": {
"grafast": "^0.1.1-beta.1",
"graphile-config": "^0.0.1-beta.4",
"grafast": "^0.1.1-beta.2",
"graphile-config": "^0.0.1-beta.5",
"graphql": "^16.1.0-experimental-stream-defer.6"

@@ -68,3 +68,3 @@ },

"@types/jest": "^29.5.4",
"graphile-export": "^0.0.2-beta.6",
"graphile-export": "^0.0.2-beta.7",
"graphql": "16.1.0-experimental-stream-defer.6",

@@ -71,0 +71,0 @@ "jest": "^29.6.4",

@@ -44,5 +44,4 @@ # graphile-build

<td align="center"><a href="https://www.netflix.com/"><img src="https://graphile.org/images/sponsors/Netflix.png" width="90" height="90" alt="Netflix" /><br />Netflix</a> *</td>
<td align="center"><a href=""><img src="https://graphile.org/images/sponsors/chadf.png" width="90" height="90" alt="Chad Furman" /><br />Chad Furman</a> *</td>
<td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
</tr><tr>
<td align="center"><a href="https://stellate.co/"><img src="https://graphile.org/images/sponsors/Stellate.png" width="90" height="90" alt="Stellate" /><br />Stellate</a> *</td>
<td align="center"><a href="https://www.accenture.com/"><img src="https://graphile.org/images/sponsors/accenture.svg" width="90" height="90" alt="Accenture" /><br />Accenture</a> *</td>

@@ -49,0 +48,0 @@ <td align="center"><a href="https://microteam.io/"><img src="https://graphile.org/images/sponsors/micro.png" width="90" height="90" alt="We Love Micro" /><br />We Love Micro</a> *</td>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc