GraphQL Configuration Files
Note
This page describes a legacy configuration file format. You should
only use this information if you're using the deprecated
realm-cli
.
Any configuration files you pull with App Services CLI or export from the UI use the latest configuration version. For detailed information on the current configuration file format, see App Configuration.
GraphQL is deprecated. Learn More.
You can configure the GraphQL API for your application in
the graphql
directory:
app/ └── graphql/ ├── config.json └── custom_resolvers └── <resolver name>.json
Service Configuration
{ "use_natural_pluralization": <Boolean>, "disable_schema_introspection": <Boolean> }
Field | Description |
---|---|
use_natural_pluralization Boolean |
You can only set the value to If If ExampleApp Services can use either a natural plural or a default plural for a generated "mouse" type:
|
disable_schema_introspection Boolean | This value is If This setting is useful for production Apps that do not want to expose their GraphQL schema to the public. When introspection is disabled, clients like GraphiQL cannot show docs for the API schema or autocomplete queries and mutations. |
Custom Resolver Configuration
{ "on_type": "<Parent Type Name>", "field_name": "<Resolver Field Name>", "function_name": "<Resolver Function Name>", "input_type": "<Input Type Name>" | { <JSON Schema> }, "input_type_format": "<Input Type Format>", "payload_type": "<Payload Type Name>" | { <JSON Schema> }, "payload_type_format": "<Payload Type Format>", }
Field | Description | |||
---|---|---|---|---|
on_type String | The parent type that exposes the custom resolver as one of its fields. Valid Options:
| |||
field_name String | The name of the field on the parent type that exposes the custom resolver. The field name must be unique among all custom resolver on its parent type. If the field name matches a field in the parent type's schema, the custom resolver overrides the schema type. | |||
function_name String | The name of the function that runs when the
resolver is called. The function arguments may accept a single argument
(configured by input_type and input_type_format ) and must return
a payload value (configured by payload_type and
payload_type_format ). | |||
input_type String | JSON Schema | The type of the resolver's input argument (if it accepts input). You
can specify either the name of another type in your GraphQL schema or a
custom JSON schema specific to the resolver. | |||
input_type_format String | A metadata description of the Valid Options: | |||
payload_type String | JSON Schema | The type of the value returned in the resolver's payload. You can specify either the name of another type in your GraphQL schema or a custom JSON schema specific to the resolver. If you do not specify a payload type, the resolver returns a
| |||
payload_type_format String | A metadata description of the Valid Options: |