This commit is contained in:
Robert Schäfer 2019-03-24 22:48:44 +01:00
parent 1cbab2a5c4
commit 4d70ba68c5
3 changed files with 6 additions and 6 deletions

View File

@ -16,6 +16,6 @@ export default {
UpdateUser: setUpdatedAt, UpdateUser: setUpdatedAt,
UpdatePost: setUpdatedAt, UpdatePost: setUpdatedAt,
UpdateComment: setUpdatedAt, UpdateComment: setUpdatedAt,
UpdateOrganization: setUpdatedAt, UpdateOrganization: setUpdatedAt
} }
} }

View File

@ -3,12 +3,12 @@ import cloneDeep from 'lodash/cloneDeep'
const defaultOrderBy = (resolve, root, args, context, resolveInfo) => { const defaultOrderBy = (resolve, root, args, context, resolveInfo) => {
const copy = cloneDeep(resolveInfo) const copy = cloneDeep(resolveInfo)
const newestFirst = { const newestFirst = {
kind: "Argument", kind: 'Argument',
name: { kind: "Name", value: "orderBy" }, name: { kind: 'Name', value: 'orderBy' },
value: { kind: "EnumValue", value: "createdAt_desc" } value: { kind: 'EnumValue', value: 'createdAt_desc' }
} }
const [fieldNode] = copy.fieldNodes const [fieldNode] = copy.fieldNodes
if(fieldNode) fieldNode.arguments.push(newestFirst) if (fieldNode) fieldNode.arguments.push(newestFirst)
return resolve(root, args, context, copy) return resolve(root, args, context, copy)
} }

View File

@ -1,5 +1,5 @@
import Factory from '../seed/factories' import Factory from '../seed/factories'
import { host, login } from '../jest/helpers' import { host } from '../jest/helpers'
import { GraphQLClient } from 'graphql-request' import { GraphQLClient } from 'graphql-request'
let client let client