GithubHelp home page GithubHelp logo

Proposal allow aliasing fields about graphql HOT 3 CLOSED

neo4j avatar neo4j commented on July 28, 2024 1
Proposal allow aliasing fields

from graphql.

Comments (3)

darrellwarde avatar darrellwarde commented on July 28, 2024

This is going to be more valuable for users of this library with an existing dataset, but want to map the backend property to a different field name on the frontend. These users aren't our current target audience, but I will leave this open as it probably is a feature we should add in the future.

from graphql.

Andy2003 avatar Andy2003 commented on July 28, 2024

@darrellwarde You may have a look at lib_directives.graphql. This is how we define the directives in java. This file (and neo4j_types.graphql) are then loaded into the user provided schema:

https://github.com/neo4j-graphql/neo4j-graphql-java/blob/master/core/src/main/kotlin/org/neo4j/graphql/SchemaBuilder.kt#L225-L237

This is especially helpful since the graphql framework will take care about validating the schema and applying default values.

from graphql.

danstarns avatar danstarns commented on July 28, 2024

@Andy2003 in the current implementation we don't type the directives, as untyped means we can offer greater flexibility IMO*, this is up for discussion internally. If you look at the output schema; no sign of directives. The directive metadata is stored on the Neo4jGraphQL class instead. I do think we should pick up on enum values over strings, in certain places, and so something defo worth looking into.

PS - I think this comment is in the wrong place

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