Tag: postgraphql

Graphql的date字段types必须是输出types,但得到:未定义

我有一个与node / expres和ES6运行的graphql服务器,我想迁移到打字稿,当我想要做graphql架构我遇到一些datetypes的问题。 我知道graphql不包含本地datetypes,但是在我的ES6实现中,我使用graphql-date来支持这个限制。 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; } } }; […]