Sascha
02/05/2021, 12:50 PMordering: { myField: true }
it makes providing an orderBy
mandatory instead of optional.Ryan
02/05/2021, 12:54 PMordering
on a CRUD method? If so, I’m not facing this as only the input inside the orderBy
is mandatory and not orderBy
itself.Sascha
02/05/2021, 12:55 PMSascha
02/05/2021, 12:55 PMt.model("FormPrototype").items({ type: "Item", pagination: false, ordering: {
position: true
} });
Sascha
02/05/2021, 12:56 PM[GraphQL error]: Message: Field "items" argument "orderBy" of type "[FormPrototypeItemsOrderByInput!]!" is required, but it was not provided., Location: undefined, Path: undefined
Ryan
02/05/2021, 12:57 PMt.model.posts({ ordering: { title: true } })
And the resulting type is not required:Ryan
02/05/2021, 12:57 PMSascha
02/05/2021, 1:04 PMSascha
02/05/2021, 1:04 PMtype QuestPrototype {
...
items(orderBy: [FormPrototypeItemsOrderByInput!]!): [Item!]!
...
}
Sascha
02/05/2021, 1:11 PMRyan
02/05/2021, 1:14 PMconst Composite = ns.objectType({
name: 'Composite',
definition(t) {
t.model('User').id()
t.model('User').posts({ ordering: { title: true } })
},
})
Resulting GraphQL:Ryan
02/05/2021, 1:15 PMSascha
02/05/2021, 3:03 PM"nexus": "^1.0.0",
"nexus-plugin-prisma": "^0.27.0",
Sascha
02/05/2021, 3:03 PM"@prisma/client": "2.13.1"
Sascha
02/05/2021, 3:04 PMSascha
02/05/2021, 3:04 PMSascha
02/05/2021, 4:09 PMRyan
02/08/2021, 7:39 AM"nexus": "^1.0.0",
"nexus-plugin-prisma": "^0.29.0",
Also Prisma 2.15.0Ryan
02/10/2021, 1:23 PMSascha
02/21/2021, 1:18 AM