Comments (6)
Thanks a lot for the investigations. I think the conclusion is that the issue is on the Hasura side.
Our production instance is still running on Hasura v1.3.3 but in the mean time they have released Hasura v2.x which has some breaking changes but we are going to migrate to that version.
So I installed Hasura v2.x on my local environment and couldn't reproduce the problem. It seems like the schema that is generated is now correct and elm-graphql is able to generate the stubs for it.
Upon investigating a bit I think the main difference is
v1.3.3
"""
select columns of table "external_user"
"""
enum external_user_select_column
In v2.0.10 this enum is no longer present (I attached the full schemas for your information).
v1.3.3
schema_v1.3.3.graphql.txt
v2.0.10
schema_v2.0.10.graphql.txt
And in case it would be of any use, here is also the result from the introspection query (on v1.3.3 which had the problem):
hasura_v1.3.3_introspection.json.txt
from elm-graphql.
Hello @dvekeman, thank you for reporting that! Do you know what the resulting GraphQL Schema Definition Language (SDL) snippet would be?
from elm-graphql.
Sure, attached is a minimal example. Is this what you were looking for?
"""
columns and relationships of "external_user"
"""
type external_user
from elm-graphql.
Hey @dvekeman, thanks for the info, I'm not sure how to translate that to GraphQL types, though. Could you try sharing it with the GraphQL types in Schema Definition Language? Here's one reference that explains SDL: https://www.digitalocean.com/community/tutorials/graphql-graphql-sdl.
It looks like Hasura also has a guide on exporting SDL: https://hasura.io/docs/latest/graphql/core/guides/export-graphql-schema.html. You could try to export it from that setup, and then just share the relevant section of the exported SDL. That would be a big help if you don't mind!
from elm-graphql.
In my above comment there is a text file with a link (https://github.com/dillonkearns/elm-graphql/files/7297112/schema.graphql.txt). Maybe you overlooked it but I believe that's what you are looking for?
I generated the file using graphqurl as described on the Hasura documentation.
It is the schema for the (hasura) role 'test' which I created for this ticket. This role only has access to the external_user relation and given I didn't allow any permissions on any of the columns the type got generated as an empty type.
Let me know if you are looking for something else.
Regards
Dieter
from elm-graphql.
Hello @dvekeman, sorry for the slow response on this. Yes, I see now that you had attached what I asked for earlier, thanks for clarifying!
So I did some experimentation and I found that I couldn't even get the end-to-end test to parse that schema because the SDL validator considers it invalid GraphQL schema.
Here's a relevant test case:
And the relevant code:
Maybe you could share the result of the introspection JSON query (https://github.com/dillonkearns/elm-graphql/blob/068056540eb566fdf888aa1620605173b7b96511/docs/introspection-query.gql)? Then I could make a test case for that to handle that case.
from elm-graphql.
Related Issues (20)
- Enhancement - Add support for Dgraph HOT 1
- non null list of non null list ofโฆ HOT 6
- Include an exhaustive query for each type HOT 3
- Add operationName to mutation request body HOT 1
- Enum with underscore as a leading character, changed after generating elm code. HOT 1
- Scalar decoder fails when the field contains an object. HOT 1
- Scalars should not be encoded as json in mutations HOT 3
- Enforce nonempty list in required list arguments HOT 3
- Selecting implementation attributes from interfaces HOT 2
- Corrupt package data for 5.0.5? HOT 1
- Requesting feedback on the following changes to the serializeChildren function regarding field hashing HOT 2
- Can not find ScalarCodecs HOT 1
- Feature request: Convenience functions for primitive comparisons HOT 3
- Idea: serialize invalid JSON Input Values as arguments
- Missing fragment in Interface `Fragments` type HOT 1
- Idea: include deprecation warnings into the generated code as comments HOT 1
- Building large queries takes a long time and pauses the UI HOT 2
- Encode function for enums is missing HOT 1
- Generate input object helpers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-graphql.