I have a graphql server running with node/expres and ES6, I am trying to migrate to typescript, when I want to do graphql schema I have experiencing some problems with date types. I know that graphql does not contain a native date type, but in my ES6 implementation, I have used graphql-date to suply this limitation.
import {
GraphQLObjectType,
GraphQLSchema,
GraphQLID,
} from 'graphql';
import GraphQLDate from 'graphql-date';
const events = new GraphQLObjectType({
name: 'events',
description: 'This represent an Event',
fields: () => {
return {
id: {
type: GraphQLID,
resolve(event) {
return event.id;
}
},
start: {
type: GraphQLDate,
resolve(event) {
return event.start;
}
}
};
}
});
the problem is that in my project with typescript when run server I get this message:
Error: events.start field type must be Output Type but got: undefined.