GraphQL Error field type must be Input Type but got:undefined

Answer • 1 Asked • Jun 24 2019
Here is the mutation:
const createNotebook = mutationWithClientMutationId ({ name: 'CreateNotebook', inputFields: { token: { type: GraphQLString, }, details: { type: NotebookDetails, }, }, outputFields: { }, async mutateCRNotebook(input, context) { const data = getJSONFromRelativeURL(input.token); }, });

Here is the schema used in the details field of the mutation:
const NotebookDetails = new GraphQLObjectType({ name: 'NotebookDetails', interfaces: [nodeInterface], fields: () => ({ id: globalIdField('NotebookDetails'), description: { type: GraphQLString, description: '...', resolve(obj) { return obj.description; }, }, language: { type: GraphQLString, description: '...', resolve(obj) { return obj.language; }, }, }), });

Error I am getting on running this code is :
api_1 | Error: CreateNotebookInput.details field type must be Input Type but got: NotebookDetails.

Write your answer...

On a mission to build Next-Gen Community Platform for Developers