mirror of
https://github.com/strapi/strapi.git
synced 2025-07-31 04:45:54 +00:00
Merge pull request #11592 from strapi/v4/graphql-remove-manually-added-timestamps
[V4] GraphQL - Remove Manually Added Timestamps
This commit is contained in:
commit
e40aa0c99e
@ -275,10 +275,9 @@ module.exports = context => {
|
||||
isRelation,
|
||||
} = utils.attributes;
|
||||
|
||||
const { attributes, modelType, options = {} } = contentType;
|
||||
const { attributes, modelType } = contentType;
|
||||
|
||||
const attributesKey = Object.keys(attributes);
|
||||
const hasTimestamps = isArray(options.timestamps);
|
||||
|
||||
const name = (modelType === 'component' ? getComponentName : getTypeName).call(
|
||||
null,
|
||||
@ -293,17 +292,7 @@ module.exports = context => {
|
||||
t.nonNull.id('id');
|
||||
}
|
||||
|
||||
// 1. Timestamps
|
||||
// If the content type has timestamps enabled
|
||||
// then we should add the corresponding attributes in the definition
|
||||
if (hasTimestamps) {
|
||||
const [createdAtKey, updatedAtKey] = contentType.options.timestamps;
|
||||
|
||||
t.nonNull.dateTime(createdAtKey);
|
||||
t.nonNull.dateTime(updatedAtKey);
|
||||
}
|
||||
|
||||
/** 2. Attributes
|
||||
/** Attributes
|
||||
*
|
||||
* Attributes can be of 7 different kind:
|
||||
* - Scalar
|
||||
|
Loading…
x
Reference in New Issue
Block a user