почему моя временная метка, которая отображается в graphql, отличается от базы данных? например в моем БД свое шоу 2020-01-01 10:10:10. Но в графике API я sh 2020-01-01T03: 10: 10.000Z. Я использую postgresql в качестве базы данных. Вот мой код:
const Notification = new graphql.GraphQLObjectType({
name: 'Notification',
fields: () => ({
id: { type: graphql.GraphQLInt },
platform: { type: graphql.GraphQLString },
action: { type: graphql.GraphQLString },
image: { type: graphql.GraphQLString },
title: { type: graphql.GraphQLString },
highlight: { type: graphql.GraphQLString },
bundle: { type: graphql.GraphQLString },
sender: { type: graphql.GraphQLString },
receiver: { type: graphql.GraphQLString },
status: { type: graphql.GraphQLString },
start_publish: {
type: GraphQLDateTime
},
end_publish: {
type: GraphQLDateTime
// resolve: (fields) => new Date(Date.UTC(fields.end_publish))
},
// team: {
// type: Team,
// sqlJoin: (playerTable, teamTable, args) => `${playerTable}.team_id = ${teamTable}.id` //innerjoin
// }
})
});
const QueryRoot = new graphql.GraphQLObjectType({
name: 'Query',
fields: () => ({
notifications: {
type: new graphql.GraphQLList(Notification),
resolve: (parent, args, context, resolveInfo) => {
return joinMonster.default(resolveInfo, {}, sql => {
return client.query(sql)
})
}
},
//...
})
})