TypeError: Cannot read properties of undefined (reading 'name')
p1b1 opened this issue · comments
I came across this library and wanted to try it out. I can't figure out what the problem is. Is it something with the data I'm trying to enter into the SDL field in the live demo application? For example
type Query {
id: ID
}
Graph is generated, but when, for example I change the name for a type and enter such data in the SDL input:
type QueryTest {
id: ID
}
I get an error in the console
Can anyone explain what the problem is? It often happens that names for types are accepted in SDL input and a view is generated, but it looks like the library only accepts selected(?) names for types?
Another example:
(work)
type Example {
id: ID!
name: String
}
type Query {
getEx: [Example]
}
Error (as on the screenshot):
type Example {
id: ID!
name: String
}
type Query2 {
getEx: [Example]
}
This is correct. By default the query root type is called Query
. You can change it, but then you need also to add the schema definition
schema {
query: Query2
}
Look the whole paragraph on the specs