Giter Club home page Giter Club logo

graphql-utilities's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

graphql-utilities's Issues

Flow Type Annotations

Using Flow will greatly reduce various bugs and it should be easy to implement given that GraphQL.js is written with it.

Integration Tests

To ensure we're catching edge cases for most use cases we should have an integration test suite.

Explore exporting buildType and buildSchema functions

build is very useful and convenient in that it can produce any number of types. Sometimes it might be inconvenient to get a type map though.

If we export the internal buildSchema and buildType functions then the developer could potentially use these to build a single type (or schema) and expect a GraphQLType or GraphQLSchema as an output instead of a map of those 2 things.

Would love to hear people's thoughts on adding these to the public API.

Restructure `build` for building GraphQLSchema

There are various problems when trying to build a schema that make the API more confusing.

  • Inferring a schema comes with the problem of it not being intuitive where build will check for the operations. Can they all be type dependencies? Do they all have to be in the AST?
  • Schema must declare directives and types and these cannot be lazily evaluated, meaning that for this particular use case build wouldn't support thunks for type dependencies. This is inconsistent.
  • Finally, because a GraphQL schema does not have a name, it's impossible to deterministically set the schema config via the config argument of build.

Perhaps it would be best to delegate schema creation to a separate function and use build only for types. While it adds an extra function it reduces complexity by separating concerns.

Add support for imports

We should add support to import files from .graphql files. You could import another .graphql file or a .js file that has a build config for it.

Add resolve function later

Would it be possible to provide an API to add the resolve functions onto the build output at a later point in time. I would prefer to keep my data type specification separate from the details of resolution.

GraphQL Custom Types

The next utility after build should be custom GraphQL types, mostly scalars, that facilitate validation. Potential types include GraphQLURL, GraphQLJSON, GraphQLEmail, GraphQLUnsignedInt, and many more!

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.