Giter Site home page Giter Site logo

ENUM raw values about graphql_codegen HOT 3 OPEN

ysaakpr avatar ysaakpr commented on August 16, 2024 1
ENUM raw values

from graphql_codegen.

Comments (3)

budde377 avatar budde377 commented on August 16, 2024 1

Interesting use-case, I don't think we can use enhanced enums to solve this because they require a const constructor. We could possibly save a enumValue$raw field on the parent class for every enumValue fields.

class DataObject {
  Enum$Value enumValue;
  String enumValue$raw;

  List<Enum$Value> enumValues;
  List<String> enumValues$raw;
}

Let me think about it.

from graphql_codegen.

github-actions avatar github-actions commented on August 16, 2024

👋 @ysaakpr
Thank you for raising an issue. I will investigate the issue and get back to you as soon as possible.
Please make sure you have provided enough context.

This library is created and maintained by me, @budde377. Please consider supporting my work and ensure our survival by donating here.

from graphql_codegen.

ysaakpr avatar ysaakpr commented on August 16, 2024

yeah... its about preserving the incoming value, and letting the client allowing to read the raw value as a string, can be still making sure we have the enum with unknown state and can still access the raw value that caused the unknown state, usfull for debugging or client app not so breaking for every change.

The app can show the raw value and say a warning, possibility u are using a old version of the app.

from graphql_codegen.

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.