Setu-TS
    Preparing search index...

    Type Alias GraphqlPluginOptions

    GraphqlPluginOptions: (GraphqlSchemaFirstOptions | GraphqlCodeFirstOptions) & {
        apq?: GraphqlApqOptions;
        buildContext?: (input: GraphqlContextInput) => unknown | Promise<unknown>;
        documentCacheSize?: number;
        formatError?: (error: unknown) => unknown;
        graphiql?: boolean;
        graphqlModule?: GraphqlModuleLike;
        introspection?: boolean;
        maskInternalErrors?: boolean;
        maxBatchSize?: number;
        maxDepth?: number;
        maxNodes?: number;
        path?: string;
        rootValue?: unknown;
        subscriptions?: GraphqlSubscriptionsOptions;
        validationRules?: unknown[];
    }

    Union of schema construction options — mutually exclusive arms.

    Supplying both arms results in a compile error due to the ?: never fields.

    Type Declaration

    • Optionalapq?: GraphqlApqOptions

      APQ (Automatic Persisted Queries) configuration. Absent → APQ disabled.

      0.3.0

    • OptionalbuildContext?: (input: GraphqlContextInput) => unknown | Promise<unknown>

      Custom context builder. Receives services and request, returns context value.

    • OptionaldocumentCacheSize?: number

      Maximum number of documents to cache. Defaults to 1000. Set to 0 to disable.

    • OptionalformatError?: (error: unknown) => unknown

      Custom error formatter applied after masking.

    • Optionalgraphiql?: boolean

      Enable GraphiQL UI. Defaults to true.

    • OptionalgraphqlModule?: GraphqlModuleLike

      Injected graphql module to use instead of lazy loading. Required when the application uses its own graphql copy.

    • Optionalintrospection?: boolean

      Enable schema introspection. Defaults to true.

    • OptionalmaskInternalErrors?: boolean

      Mask internal errors. Defaults to true.

    • OptionalmaxBatchSize?: number

      Maximum number of requests in a batch. 0 (default) disables batching; an array body is still refused with 400. Set above 0 to enable.

      0.3.0

    • OptionalmaxDepth?: number

      Maximum query depth. Defaults to 10. Set to 0 to disable.

      Bounds NESTING only. A document can be two levels deep and still ask for a hundred thousand fields, because every alias is a separate field — see GraphqlPluginOptions.maxNodes, which bounds that dimension.

    • OptionalmaxNodes?: number

      Maximum number of fields a document may resolve, counting every alias separately and expanding each fragment spread at its spread site.

      Omitted or 0, unbounded — the released behaviour. The only limit then standing between an alias bomb and the process is the request-body size, which one HTTP request can exhaust: 100,000 aliases at depth 2 is a ~2 MB document.

      Left off by default because a legitimate large document in an existing application would otherwise start being refused. Pick a budget from the largest query your own clients issue and set it.

      0.5.0

    • Optionalpath?: string

      Path for the GraphQL endpoint. Defaults to '/graphql'.

    • OptionalrootValue?: unknown

      Root value passed to execute.

    • Optionalsubscriptions?: GraphqlSubscriptionsOptions

      Subscription transport configuration. Absent → no transport routes are registered (byte-identical to M51 behavior).

      0.3.0

    • OptionalvalidationRules?: unknown[]

      Additional validation rules to append.