-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full graph generators not working on nested objects: Assert failed: Second arg to fmap must be a generator (generator? gen) #10
Comments
Hi, The schema should be the uncompiled schema. It looks like your schema has custom scalars, so are you supplying generators for those custom scalars to lacinia-gen? The example on the readme shows how to use it if you have custom generators: https://github.com/oliyh/lacinia-gen#custom-scalars Hope this helps. |
Additionally is your query here correct? Your schema declares that (let [f (lg-query/generate-fn schema {})]
(f "query { get_countries(query_str: \"IN\") { countries } }")) |
Yes, I'm passing scalars, like so, and still get an error:
|
Hmm, that last error comes from Lacinia, not lacinia-gen. I guess you have |
I removed
To take a step back, I'd be happy just relying on generating object graphs, instead of query api. What do you think is required to provide this support with a working schema.edn? I'd be happy to contribute if you can point to the code. |
Hi, Can you share a minimum failing schema and I can have a look? Is it your get_countries one in your first post? Thanks |
Sure, I'll provide this soon ... |
I have a working schema that compiles successfully with lacinia. However lacinia-gen throws multiple errors for both full graph and query result apis, for simple objects and objects with nested and input objects. It's not apparent from the test-check errors what's missing.
For most objects, I get a NullpointerException.
It is also not clear whether the 'schema' passed to lacinia-gen is a raw edn schema, or a compiled schema from lacinia (see
load-schema
)I've used both variations and get NPEs with a compiled schema.
With queries, I always get the same error:
Cannot query field get_countries on type QueryRoot ... :extensions {:field get_countries, :type :QueryRoot}
The above query works fine on graphiql.
Any suggestions debugging these errors is much appreciated. I'm also using your re-graph library.
The text was updated successfully, but these errors were encountered: