Code Monkey home page Code Monkey logo

Comments (5)

gjtorikian avatar gjtorikian commented on September 27, 2024

I may be misunderstanding, but does:

    let mut file = File::open("schema.graphql").expect("Unable to open file");
    let mut contents = String::new();
    file.read_to_string(&mut contents);

    let definitions = gqlidl::parse_schema(contents.as_str()).unwrap();

not work for you?

from graphql-idl-parser.

joprice avatar joprice commented on September 27, 2024

I did that, but that's where I ran into issues. I wanted to iterate through the definitions and do different things with the fields of the enum cases:

    for def in definitions {
        match def {
            TypeDefinition::ScalarType(scalar) => {
                println!("{}", scalar.name);
            },
       ...

But all the enum fields are private.

from graphql-idl-parser.

gjtorikian avatar gjtorikian commented on September 27, 2024

Ah, I see. Sure, let me update them!

from graphql-idl-parser.

gjtorikian avatar gjtorikian commented on September 27, 2024

Sorry, this is taking a bit longer to fix because apparently this crate no longer works on Rust 1.26 due to changes in dependent libraries!

from graphql-idl-parser.

joprice avatar joprice commented on September 27, 2024

No rush. Thanks for updating it

from graphql-idl-parser.

Related Issues (5)

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.