From 534fa00c0bc6b6df0ff84218cf0b200448aa7e36 Mon Sep 17 00:00:00 2001 From: Johann Pinson Date: Thu, 24 May 2018 17:13:14 +0200 Subject: [PATCH] fix(graphql): change timestamp format snake_case to camelCase --- packages/strapi-plugin-graphql/services/GraphQL.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/strapi-plugin-graphql/services/GraphQL.js b/packages/strapi-plugin-graphql/services/GraphQL.js index e0d4ebd5b2..759a1acf65 100644 --- a/packages/strapi-plugin-graphql/services/GraphQL.js +++ b/packages/strapi-plugin-graphql/services/GraphQL.js @@ -407,15 +407,15 @@ module.exports = { // Add timestamps attributes. if (_.get(model, 'options.timestamps') === true) { Object.assign(initialState, { - created_at: 'String', - updated_at: 'String' + createdAt: 'String', + updatedAt: 'String' }); Object.assign(acc.resolver[globalId], { - created_at: (obj, options, context) => { // eslint-disable-line no-unused-vars + createdAt: (obj, options, context) => { // eslint-disable-line no-unused-vars return obj.createdAt || obj.created_at; }, - updated_at: (obj, options, context) => { // eslint-disable-line no-unused-vars + updatedAt: (obj, options, context) => { // eslint-disable-line no-unused-vars return obj.updatedAt || obj.updated_at; } });