Unknown type when type exists #841
Answered
by
spawnia
LorenzoTuri
asked this question in
Q&A
Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
LorenzoTuri
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody, I probably found an error with the arguments on nested types...
Just to share some unnecessary info, what I'm trying to build is a CRUD entity agnostic controller with graphQL APIs in a symfony bundle. (The entities below (site, entitySiteUrl) are just entities taken from another project on wich I'm developing and testing)
I can't truly share the code since it's a little complicated to understand, but what I'm doing is to inject types, queries and mutations by creating them dynamically (php) into the schema, then quering and using resolve function to query doctrine.
On "normal" usage it works... for example this query
query { entitySiteUrl (id: "01F2D393159DX6PFD7PAXD0YGH"){ id, url, site (baseUrl: "404") {id, baseUrl} } }
Actually returns the resulting data (don't mind the fact the data is not actually filtered, that part needs to be build, but I need before the "nested filters" part to "build it better")
result:
The problem comes while building "complex" (maybe is better to say nested) filters...
query { siteList ( siteUrls: { baseUrl: "123" } ){ id, baseUrl, siteUrls {id} } }
This error only occurs with filtering the siteUrls fields (in this case baseUrl, but it's not different with other fields).
Also by using this query (the inverse side of the query before)
query { entitySiteUrlList ( site: { url: "123" } ){ id, site {id} } }
The code also returns a similar error (just with "site" instead of "entitySiteUrl")
Most of the schema creation code revolves simply around ObjectType and FieldArguments, so it should not incurr in strange lazy-loading mechanisms as far as I've seen in source code...
Il'' share the important part of the generated schema made from SchemaPrinter
In case you need other infos or whatever just tell me and I'll provide them
Beta Was this translation helpful? Give feedback.
All reactions