Giter VIP home page Giter VIP logo

Comments (5)

ardatan avatar ardatan commented on May 15, 2024

Let me explain why you have this issue. First in Swagger, enums are not named types and they are not working like key/value pairs as in TypeScript and GraphQL so we cannot generate a key for empty value then you get that invalid typings.

You have multiple enum types with similar/same values because enums are not named types in Swagger so even if they are similar it is not possible to know if they are same enum or not so each enum definition is considered as a different enum type.

As a solution, we will prefix numeric keys with _ and add EMPTY instead of empty key. I will submit a PR and let you know when alpha version is ready to test.

Thanks for reporting this issue!

from graphql-mesh.

ardatan avatar ardatan commented on May 15, 2024

Could you try with the following alpha version?
0.1.5-alpha-6131ae4.0

from graphql-mesh.

stefan-- avatar stefan-- commented on May 15, 2024

@ardatan thanks mate, version 0.1.5-alpha-6131ae4.0 solves the issue.

Concerning the unnamed enums, is it an option to check for object equality in favour of clean typings so that objects with the same key/value pairs are considered to be the same type?

from graphql-mesh.

ardatan avatar ardatan commented on May 15, 2024

@stefan-- We don't have that kind of option yet but I added it as todo :) #264

from graphql-mesh.

ardatan avatar ardatan commented on May 15, 2024

Available in 0.1.5!

from graphql-mesh.

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.