Coder Social home page Coder Social logo

graphql-loader's People

Contributors

csillag avatar meta-dreamer avatar nicolaslopezj avatar zvictor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

graphql-loader's Issues

typeDefs has to be an array of strings

from the documentation, its unclear that typeDefs has to be an array of strings, instead of a string.

This fails silently.

allow typeDefs to be a string or highlight it in the readme

Union types are not parsed

If a union type exists in the typeDefs, it is not parsed and made available in the resulting schema.

http://graphql.org/learn/schema/#union-types

Example typeDefs:

type TextActivity {
  title
  text
}

type VideoActivity {
  title
  video
}

union Activity = TextActivity | VideoActivity

Result when building AST Schema: Error: Type "Activity" not found in document.

[Comments] Commented types are parsed

Even commented type declarations are parsed, e.g.

## Color it is
# type Color {
#   name: String
#   hex: String
#   red: Int
#   green: Int
#   blue: Int
# }

# Shape it is
type Shape {
  name: String
  area: Float
}

both of these type will be parsed by graphql-loader.

Messes up types that implement multiple interfaces

If I have a definition like this:

interface Magic {
    foo: String
}

interface Trick	{
    bar: int
}

type User implements Magic, Trick {
    foo: String
    bar: int
}

and I parse it with graphql-loader, it gets mangled like this:

interface Magic {
    foo: String

}

interface Trick {
    bar: int

}

Trick {
    foo: String
    bar: int

}

... which is (of couse) invalid GraphQL, and so calling makeExecutableSchema() on it will fail with a parse error.

Messes up type names that have numbers

If I have a type like this:

type FromMe2You {
    message: String
}

and process it with graphql-loader, it will be maimed into this:

You {
    message: String

}

The reason for this is that it doesn't like the number in the name of the type.
I am not exactly sure what the specs say here, but the GraphQL parser itself has no problem with the number, so I see no reason why should it be forbidden...

Comments not supported on root type

# Color it is
type Color {
  name: String
  hex: String
  red: Int
  green: Int
  blue: Int
}

if you do loadSchema, then getSchema, comment is gone. And that leads to introspection queries not returning a description for the type.

[feature] Merge query

Hello,
You allows to split schemas/resolvers in different files however we cannot define more than one Query otherwise the error Error: Must provide only one query type in schema is thrown. See apollographql/apollo-server#43 to find solutions to merge queries into a single one.

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.