For testing scenarios, you can configure a mock resolver in a GraphQLResolverMap Gloo custom resource. Mock resolvers do not require resolver servers to exist, and instead can immediately return a mocked response. Then, map fields from your schema definition to resolvers in a GraphQLSchema CR.

Step 1: Mock resolvers

Define your mock resolvers in a GraphQLResolverMap CR. Note that you can specify only one of asyncResponse, errorResponse, or syncResponse.

Step 2: Map schema to resolvers

Map the types and fields from your schema definition (ApiDoc) to the resolver servers (GraphQLResolverMap) in a GraphQLSchema Gloo CR. The GraphQLSchema CR ensures that the GraphQL resolver services can access the field information for each type.

Reference

For more information, see the Gloo Mesh Gateway API reference for the GraphQLResolverMap CR and GraphQLSchema CR.

Next steps

Set up routing to resolvers and apply traffic policies.