Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in buildASTSchema: Adding a Float scalar to type definition breaks the materializer #104

Closed
nemanja-stanarevic opened this issue Aug 5, 2015 · 2 comments

Comments

@nemanja-stanarevic
Copy link
Contributor

When a Float field is added to type definition, the materializer (buildASTSchema) breaks down with Error: Type Float not found in document. Adding a float field to HelloScalars test confirms the issue.

Patch is simple, one-line tweak to getTypeDefProducer function in utilities/buildASTSchema.js to add Float to innerTypeMap map, as follows:

  function getTypeDefProducer() {

    var innerTypeMap = {
      String: GraphQLString,
      Int: GraphQLInt,
++++  Float: GraphQLFloat,
      Boolean: GraphQLBoolean,
      ID: GraphQLID,
    };

With this, the new HelloScalars test passes, I'll submit a PR in a sec (updated test + patch).

dschafer added a commit that referenced this issue Aug 5, 2015
Fixes issue #104 with buildASTSchema and Float fields
@dschafer
Copy link
Contributor

dschafer commented Aug 5, 2015

Looks like #105 fixed this, thanks for the report and patch!

@dschafer dschafer closed this as completed Aug 5, 2015
@nemanja-stanarevic
Copy link
Contributor Author

Dan, you are welcome; I'm looking forward to v0.2.5 on npm :)

Thanks again for all the great work you all are putting into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants