Check fields in GraphQLObjectType with typescript

Viewed 101

I use graphql-js to do my schema and i can't detect error types on compilation with typescript :

ie :

export type CustomFieldsType = {
  id: number;
};

export default {
  type: new GraphQLNonNull(
    new GraphQLObjectType({
      name: 'DescriptionFields',
      fields: {
        id: {
          description: 'custom description for id',
          type: new GraphQLNonNull(GraphQLID),
        },
        ...
      },
    }),
  ),
  args: {
   ...
  },
  resolve: () =>...
};

Is there any way to apply my custom CustomFieldsType on my GraphQLObjectType ?

0 Answers
Related