Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Feb 7, 2023
1 parent 1722fe4 commit 11f8d4c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
4 changes: 4 additions & 0 deletions grafast/grafast/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ declare global {
namespace GraphileConfig {
interface GraphQLRequestContext {}
interface Preset {
/**
* Options that control how `grafast` should execute your GraphQL
* operations.
*/
grafast?: GrafastOptions;
}
interface GrafastHooks {
Expand Down
7 changes: 7 additions & 0 deletions graphile-build/graphile-build-pg/src/plugins/PgJWTPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ declare global {
}

interface GraphileBuildGatherOptions {
// TODO: we may want multiple of these!
/**
* If you would like PostGraphile to automatically recognize a PostgreSQL
* type as a JWT, you should pass a tuple of the
* `["<schema name>", "<type name>"]` so we can recognize it. This is
* case sensitive.
*/
pgJwtType?: [string, string];
}

Expand Down
24 changes: 21 additions & 3 deletions graphile-build/graphile-build/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,32 @@ declare global {
interface GraphileBuildInflectionOptions {}
interface GraphileBuildGatherOptions {}
interface SchemaOptions {
// TODO: review this option
/**
* Should we enable subscriptions in the schema?
*/
subscriptions?: boolean;
/**
* If your schema includes compatibility with the GraphQL Global Object
* Identification Specification, typically this will be called 'id'.
* However the term 'id' often conflicts with databases which commonly
* use 'id' as their primary key name, so we give you the option to
* rename it.
*/
nodeIdFieldName?: string;

/**
* `SwallowErrorsPlugin` by default will "swallow" errors, allowing you
* to continue building your GraphQL schema even if errors (such as
* naming conflicts) occur. It is recommended that you set this option to
* `true` in your production configuration to disable this behavior.
*/
dontSwallowErrors?: boolean;

/**
* If set to 'only' then connections will be avoided, preferring lists.
* If set to 'omit' then lists will be avoided, preferring connections.
* If set to 'both' then both lists and connections will be generated.
* - 'only': connections will be avoided, preferring lists
* - 'omit': lists will be avoided, preferring connections
* - 'both': both lists and connections will be generated
*/
simpleCollections?: "only" | "both" | "omit";
}
Expand Down
18 changes: 18 additions & 0 deletions graphile-build/graphile-build/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,26 @@ export interface GatherPluginContext<
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.GraphileBuildInflectionOptions;
/**
* 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.GraphileBuildGatherOptions;
/**
* 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;
}

Expand Down

0 comments on commit 11f8d4c

Please sign in to comment.