function

New

func New(options ...Options) ridu.Plugin

Register one GraphQL transport with secure defaults.

Source plugins/graphql/graphql.go:77

@param options
The options value.
@returns
The declared result.

Pass zero or one Options value; more than one is invalid. The plugin uses the same access, validation, hooks, transactions, and redaction engine as REST.

Example

go
Plugins: []ridu.Plugin{
  graphql.New(graphql.Options{
    Path:               "/graphql",
    MaxDepth:           12,
    AllowIntrospection: false,
  }),
}

Related types

  • Options

    Route, request budgets, resource overrides, extensions, and validation rules.

  • Plugin

    The minimum compiled backend plugin contract.