-
-
Notifications
You must be signed in to change notification settings - Fork 822
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
graphql-js object for custom scalars #176
Comments
@Siras31 that's a great idea - it should be really easy, and probably the right syntax would be: import GraphQLJSON from 'graphql-type-json';
export const schemaString = `
scalar JSON
`;
export const resolvers = {
JSON: GraphQLJSON,
}; Want to send in a PR for it? |
Hello, I'm trying to have this issue fixed. I began writing a patch : Can someone ( @stubailo ? ) have a look ? I'd like to know if I got it right. Any comment is welcome. A few remarks :
Regards |
I wrote a little test app besides my fork of the the apollostack/graphql-tools repo, and here is what I get when I console.log(user) where user contains a User filled with mocked data :
Is it the kind of thing which was expected ? |
Would you mind opening a PR? Much easier to review that way! |
I created a PR : FYI, I don't consider this as ready to be merged at all. I'd rather expect some comments about my diff. I didn't check the "Make sure all of the significant new logic is covered by tests" checkbox in the PR yet since I think more testing could be added. I'll work on it when I have some feedback. If someone has ideas of relevant test scenarios to add, I'm interested. The task description was quite short and I'm new to this codebase, so I'm rather not sure about this PR so far. I'll fix things according to the feedback I get from people who know this code better than me. |
oops @oricordeau just seen this after the actual review.. |
It would be great to be able to use custom scalars by passing a graphql-js object.
Then, we could use some great npm modules ;)
The text was updated successfully, but these errors were encountered: