gerritvk
01/04/2019, 9:38 PMCannot return null for non-nullable field DeviceConfig.device.
Datamodel
type Device {
...
model: String! @unique
...
configs: [DeviceConfig] @relation(name: "DeviceConfigs", onDelete: CASCADE)
}
type DeviceConfig {
id: ID! @unique
device: Device! @relation(name: "DeviceConfigs", onDelete: SET_NULL)
name: String!
...
}
Query
{
deviceConfig(id:"cjqigyian00ef0d206tg116k5"){
name
id
device{
model
}
}
}
Resolver
deviceConfig: async (parent, { id }, context, info) => context.prisma.deviceConfig({ id }, info)
Result
{
"data": null,
"errors": [
{
"message": "Cannot return null for non-nullable field DeviceConfig.device.",
"locations": [
{
"line": 5,
"column": 5
}
],
"path": [
"deviceConfig",
"device"
]
}
]
}
---
When I run the following query on the Prisma API playground it returns
Query
{
deviceConfig(where:{id:"cjqigyian00ef0d206tg116k5"}){
name
id
device{
id
model
}
}
}
Result
{
"data": {
"deviceConfig": {
"name": "Standard",
"id": "cjqigyian00ef0d206tg116k5",
"device": {
"id": "cjqigxzs600e60d20sdw38x7p",
"model": "7530"
}
}
}
}
CCBCodeMonkey
01/05/2019, 4:46 AMCCBCodeMonkey
01/05/2019, 4:47 AMCCBCodeMonkey
01/05/2019, 4:47 AMCCBCodeMonkey
01/05/2019, 4:47 AManthony
01/05/2019, 5:43 AMCCBCodeMonkey
01/05/2019, 5:52 AMCCBCodeMonkey
01/05/2019, 5:52 AMCCBCodeMonkey
01/05/2019, 5:52 AMAl
01/05/2019, 9:00 AMSlackbot
01/05/2019, 9:00 AMViable
01/05/2019, 9:11 AMViable
01/05/2019, 9:12 AMViable
01/05/2019, 9:13 AMViable
01/05/2019, 9:28 AMwarchantua
01/05/2019, 2:42 PMArtur Malak
01/05/2019, 3:36 PMArtur Malak
01/05/2019, 3:36 PMArtur Malak
01/05/2019, 3:38 PMIndustrial
01/05/2019, 3:55 PMIndustrial
01/05/2019, 3:55 PMinsertManyX
mutation?Industrial
01/05/2019, 3:55 PMawait Promise.all(
apiMarkets.map((market) => {
return apolloClient.mutate({
mutation: upsertMarket,
variables: market,
})
}),
)
CCBCodeMonkey
01/05/2019, 7:29 PMCCBCodeMonkey
01/05/2019, 7:30 PMjon.major
01/06/2019, 12:38 AM.graphql
seed file?warchantua
01/06/2019, 12:34 PMivor
01/06/2019, 12:56 PMWhereInput
are not behaving as expected in my GraphQL queries, anyone know how to get around it or is it a bug?
I have a user with ID 5c2eb7d56344590009c22341
and when I query a user with id
, id_in
, id_lt
, id_gt
, id_lte
, id_gte
, id_not
, id_not_in
I get the expected results, but not with id_contains
, id_ends_with
, id_starts_with
, id_not_contains
, id_not_ends_with
, id_not_starts_with
.
For instance, this returns an empty users array
{
users(where: {id_ends_with: "c22341" }) {
id
}
}
ivor
01/06/2019, 1:00 PMwarchantua
01/06/2019, 1:33 PMimpowski
01/06/2019, 3:22 PM