Below is an example of a resolver I'm writing that's using graphql-compose to help build up our schema.
const createResolver = schemaComposer.createResolver({
kind: 'mutation',
name: 'SomeNameHere',
type: SomeTypeNameTC,
args: {
inputForm: InputFormITC,
},
resolve: ({ args }) => {
return createInputForm(args.inputForm);
}
});
My question is regarding the args
section of the resolver. How can I require that the inputForm
argument is required in the schema? If I were to declare an ID to also be passed in, as an example, I could require the ID in the schema by adding an exclamation mark.
If, however, I add an (!) to the ITC object I believe that just tells JS to require that argument and not the GraphQL schema.
args: {
id: 'ID!'
inputForm: InputFormITC!
}
I worked around this by doing something like inputForm: 'InputFormInput!'
but I'd rather have the actual object to make it easier to jump around in our IDE. Is such a thing possible in graphql-compose?