Composing results fails for single item queries
berend opened this issue · 2 comments
berend commented
Hi there,
we found a bug it seems.
Given two schemas
A
schema {
query: Query
}
type Query {
node(id: ID!): Node
Thing(id: ID!): Thing
Things(limit: limit: Int = 10): ThingList
}
interface Node {
id: ID!
}
ThingList {
list: [Thing]
}
type Thing implements Node {
id: ID!
foo: String!
}
B
schema {
query: Query
}
type Query {
node(id: ID!): Node
Thing(id: ID!): Thing
}
interface Node {
id: ID!
}
type Thing implements Node {
id: ID!
bar: String!
}
and using nautilus to combine them.
This single item query does not work:
{
Thing(id:"Thing:110915031829") {
id
foo
bar
}
}
This query does work:
{
Things(limit: 3) {
list {
id
foo
bar
}
}
}
Reason seems to be that here
Line 597 in 38e5c1a
executorExtractValue
is
did not encounter a list when expected. Point: Thing#Thing:110915031829. Field: Thing. Result map[id:Thing:110915031829 foo:foo]
We are willing to do a PR for this. Would that be welcome?
(Since it is somehow deep into your tool and we are only using this for a day, we might need a bit of guidance.)
berend commented
It looks like the reason for this is that our node-id contains a :
. Then this line
Line 512 in 38e5c1a
assumes, that we a looking at a list
berend commented
We have a fix and will add a test.