mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	fix(graphql): change timestamp format snake_case to camelCase
This commit is contained in:
		
							parent
							
								
									0a9fff5a30
								
							
						
					
					
						commit
						534fa00c0b
					
				| @ -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; | ||||
|           } | ||||
|         }); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Johann Pinson
						Johann Pinson