waterline-graphql icon indicating copy to clipboard operation
waterline-graphql copied to clipboard

JSON Scalar type issue

Open beckend opened this issue 8 years ago • 1 comments

These lines: https://github.com/strapi/waterline-graphql/blob/master/lib/scalars/json.js#L11-L12 The first one is accessing a object with key of it's kind: getParser[tree.kind], but it seems like getParser is a function with no keys, can't be right? I assume the correct way is the invokation like getParser(tree.kind).

beckend avatar Feb 11 '17 19:02 beckend

One more thing there is a clause where the default returns null https://github.com/strapi/waterline-graphql/blob/master/lib/scalars/json.js#L43. Which means the return parser.call(this, tree); https://github.com/strapi/waterline-graphql/blob/master/lib/scalars/json.js#L12 will fail when trying to call it as a function.

beckend avatar Feb 11 '17 19:02 beckend