Skip to main content
Version: v3.x beta

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:

  1. The root type names for query, mutation and subscription operations.
  2. The name for Model selection input field names (where, limit, offset, args, order_by)
  3. The enum values for order_by directions and the order_by enum type name.

Metadata structure

GraphqlConfig

KeyValueRequiredDescription
kindGraphqlConfigtrue
versionv1true
definitionGraphqlConfigV1true

GraphqlConfigV1

KeyValueRequiredDescription
queryQueryGraphqlConfigtrue
mutationMutationGraphqlConfigtrue
apolloFederationGraphqlApolloFederationConfig / nullfalse

GraphqlApolloFederationConfig

KeyValueRequiredDescription
enableRootFieldsbooleantrue

MutationGraphqlConfig

KeyValueRequiredDescription
rootOperationTypeNamestringtrue

QueryGraphqlConfig

KeyValueRequiredDescription
rootOperationTypeNamestringtrue
argumentsInputArgumentsInputGraphqlConfig / nullfalse
limitInputLimitInputGraphqlConfig / nullfalse
offsetInputOffsetInputGraphqlConfig / nullfalse
filterInputFilterInputGraphqlConfig / nullfalse
orderByInputOrderByInputGraphqlConfig / nullfalse

OrderByInputGraphqlConfig

KeyValueRequiredDescription
fieldNamestringtrue
enumDirectionValuesOrderByDirectionValuestrue
enumTypeNames[OrderByEnumTypeName]true

OrderByEnumTypeName

KeyValueRequiredDescription
directions[OrderByDirection]true
typeNamestringtrue

OrderByDirection

Value: Asc / Desc

OrderByDirectionValues

KeyValueRequiredDescription
ascstringtrue
descstringtrue

FilterInputGraphqlConfig

KeyValueRequiredDescription
fieldNamestringtrue
operatorNamesFilterInputOperatorNamestrue

FilterInputOperatorNames

KeyValueRequiredDescription
andstringtrue
orstringtrue
notstringtrue
isNullstringtrue

OffsetInputGraphqlConfig

KeyValueRequiredDescription
fieldNamestringtrue

LimitInputGraphqlConfig

KeyValueRequiredDescription
fieldNamestringtrue

ArgumentsInputGraphqlConfig

KeyValueRequiredDescription
fieldNamestringtrue
Loading...