Configuration for GraphQL API
Introduction
The GraphqlConfig object allows you to configure the GraphQL schema generated by Hasura. This object helps you configure
the common graphql schema applicable to all subgraphs within a project. As your GraphQLConfig object is shared across
all subgraphs, it lives in the /supergraph
subdirectory.
Specifically, it allows you to configure:
- The root type names for query, mutation and subscription operations.
- The name for Model selection input field names (
where
,limit
,offset
,args
,order_by
) - The enum values for
order_by
directions and theorder_by
enum type name.
Metadata structure
GraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
kind | GraphqlConfig | true | |
version | v1 | true | |
definition | GraphqlConfigV1 | true |
GraphqlConfigV1
Key | Value | Required | Description |
---|---|---|---|
query | QueryGraphqlConfig | true | |
mutation | MutationGraphqlConfig | true | |
apolloFederation | GraphqlApolloFederationConfig / null | false |
GraphqlApolloFederationConfig
Key | Value | Required | Description |
---|---|---|---|
enableRootFields | boolean | true |
MutationGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
rootOperationTypeName | string | true |
QueryGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
rootOperationTypeName | string | true | |
argumentsInput | ArgumentsInputGraphqlConfig / null | false | |
limitInput | LimitInputGraphqlConfig / null | false | |
offsetInput | OffsetInputGraphqlConfig / null | false | |
filterInput | FilterInputGraphqlConfig / null | false | |
orderByInput | OrderByInputGraphqlConfig / null | false |
OrderByInputGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
fieldName | string | true | |
enumDirectionValues | OrderByDirectionValues | true | |
enumTypeNames | [OrderByEnumTypeName] | true |
OrderByEnumTypeName
Key | Value | Required | Description |
---|---|---|---|
directions | [OrderByDirection] | true | |
typeName | string | true |
OrderByDirection
Value: Asc
/ Desc
OrderByDirectionValues
Key | Value | Required | Description |
---|---|---|---|
asc | string | true | |
desc | string | true |
FilterInputGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
fieldName | string | true | |
operatorNames | FilterInputOperatorNames | true |
FilterInputOperatorNames
Key | Value | Required | Description |
---|---|---|---|
and | string | true | |
or | string | true | |
not | string | true | |
isNull | string | true |
OffsetInputGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
fieldName | string | true |
LimitInputGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
fieldName | string | true |
ArgumentsInputGraphqlConfig
Key | Value | Required | Description |
---|---|---|---|
fieldName | string | true |