Coder Social home page Coder Social logo

Comments (7)

sunli829 avatar sunli829 commented on April 28, 2024 1

Many AST nodes of the graphql_parser don't have a position property, and I might actually create a new parser later to solve this problem.😁

from async-graphql.

sunli829 avatar sunli829 commented on April 28, 2024

Any type already exists and I have added it to support Federation. Is that what you want?

from async-graphql.

nicolaiunrein avatar nicolaiunrein commented on April 28, 2024

Yes I know and I'm using it. I wanted to implement the From trait for being able to write something like this:

let test: Any = json!({ "a": 42 }).into()

Which is only possible if I construct a graphql_parser::Value by hand because there is no impl From serde_json::Value for graphql_parser::Value. But I think I can just add impl<T> From T for Any where T: Into<graphql_parser::Value> which does not let you write code like the above quite yet but when the functionality is added to graphql_parser and also gives you more flexibility for other use-cases. I solved this in my code by implementing a helper trait which is kind of ugly and unnecessary. I will commit the code and it becomes clear. 😆

from async-graphql.

sunli829 avatar sunli829 commented on April 28, 2024

Sorry I misread it, it was serde_json::Value, in fact I've already written an json_value_to_gql_value for this ugly transformation function.😂

fn json_value_to_gql_value(value: serde_json::Value) -> Value {

from async-graphql.

nicolaiunrein avatar nicolaiunrein commented on April 28, 2024

Yes but this is the other way around. 😆 I opened an issue at graphql_parser for providing the conversion but as I wrote its not trivial because of different base types on Number. Anyway I think 26120e2 solves this issue now.

from async-graphql.

nicolaiunrein avatar nicolaiunrein commented on April 28, 2024

I think removing the dependency on graphql_parser is a good Idea!

from async-graphql.

nicolaiunrein avatar nicolaiunrein commented on April 28, 2024

Now with the dependency removed this should be possible.

from async-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.