Giter Site home page Giter Site logo

Comments (6)

dvekeman avatar dvekeman commented on July 19, 2024 1

Hi @dillonkearns

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.

dillonkearns avatar dillonkearns commented on July 19, 2024

Hello @dvekeman, thank you for reporting that! Do you know what the resulting GraphQL Schema Definition Language (SDL) snippet would be?

from elm-graphql.

dvekeman avatar dvekeman commented on July 19, 2024

Hi @dillonkearns

Sure, attached is a minimal example. Is this what you were looking for?

"""
columns and relationships of "external_user"
"""
type external_user

schema.graphql.txt

image

from elm-graphql.

dillonkearns avatar dillonkearns commented on July 19, 2024

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.

dvekeman avatar dvekeman commented on July 19, 2024

Hi @dillonkearns

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.

dillonkearns avatar dillonkearns commented on July 19, 2024

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:

https://github.com/graphql/graphql-js/blob/73025aa009039c1e2e74f7bbd088ec6ab6e07e94/src/type/__tests__/validation-test.ts#L450-L454

And the relevant code:

https://github.com/graphql/graphql-js/blob/e289e6412ca59cd6298796d61efa19d78eeb945c/src/type/validate.ts#L266-L270

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.