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

How to use with buildSchema? #37

Closed
ffxsam opened this issue May 23, 2017 · 2 comments
Closed

How to use with buildSchema? #37

ffxsam opened this issue May 23, 2017 · 2 comments

Comments

@ffxsam
Copy link

ffxsam commented May 23, 2017

How does one use this custom scalar if we're using buildSchema to build our schema, e.g.:

module.exports = buildSchema(`
  type User {
    id: ID!
    email: String!
    firstName: String!
    lastName: String!
    signupDate: DateTime!
  }
@excitement-engineer
Copy link
Owner

It does not seem to be possible. Check this issue in graphql-js for more information. However, you could check out graphql-tools if you want to create an executable schema with custom scalars. Hope this helps!

@ffxsam
Copy link
Author

ffxsam commented May 26, 2017

Thanks! I already switched to using Apollo's graphql-server which works much better with custom scalars, and implementation was super easy:

resolvers.js

const { GraphQLDateTime } = require('graphql-iso-date');

module.exports = {
  DateTime: GraphQLDateTime,
  // ...

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