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

DateTime, Date, Time, JSON - scalars proposal #30

Closed
playerx opened this issue Dec 14, 2017 · 13 comments
Closed

DateTime, Date, Time, JSON - scalars proposal #30

playerx opened this issue Dec 14, 2017 · 13 comments
Labels
kind/discussion Discussion, question or feedback

Comments

@playerx
Copy link
Contributor

playerx commented Dec 14, 2017

What do you think to add those scalars out of the box:
DateTime, Date, Time, JSON

and make it configurable to disable them.

I think I will need them in all of my apps, especially DateTime.

If you think it's good idea I can send PR.

@schickling
Copy link
Contributor

I think there's definitely value in supporting a common set of schema definitions type resolvers as a standalone package (which then could be used by graphql-yoga).

I remember @RomanGotsiy and @IvanGoncharov coming up with the same idea. Would be great to hear their thoughts!

@IvanGoncharov
Copy link

IvanGoncharov commented Dec 14, 2017

We still have this idea and to release such package. However, it blocked by graphql/graphql-spec#326 since if you define custom scalars without specifying underlying serialization type you create a lot of problems for tooling and especially for code generation.

@playerx
Copy link
Contributor Author

playerx commented Dec 14, 2017

@IvanGoncharov as I guess its still a draft implementation and I think we can add those scalars today and describe serialization type for them when it will be possible and stable.

@kbrandwijk
Copy link
Contributor

There's already graphql-iso-date for date scalars, and graphql-type-json for JSON types. I don't think we need to reinvent them again.

@playerx
Copy link
Contributor Author

playerx commented Dec 19, 2017

@kbrandwijk my proposal was just to use already implemented scalars and put the in graphql-yoga out of the box.

@kbrandwijk
Copy link
Contributor

@playerx Yes, and I completely agree with that. My response was more for @IvanGoncharov who mentioned releasing another package like that.

@schickling
Copy link
Contributor

This is also related to prisma-labs/prisma-binding#15

@IvanGoncharov
Copy link

@kbrandwijk In graphql-js 0.12.x you don't need to use any external package for JSON scalar since all scalars by default will accept all values:
https://github.com/graphql/graphql-js/blob/master/src/type/definition.js#L498
Just define it as scalar JSON inside your SDL schema 🎉

As for package I planning to do I have a few very specific features in mind not sure if it will work like intended but I will try 😄

@stale
Copy link

stale bot commented Dec 12, 2018

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale
Copy link

stale bot commented Feb 10, 2019

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale
Copy link

stale bot commented May 24, 2019

Due to inactivity of this issue we have marked it stale. It will be closed if no further activity occurs.

@stale stale bot added the status/stale label May 24, 2019
@stale
Copy link

stale bot commented May 31, 2019

Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of graphql-yoga we'll close it.
Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂

@stale stale bot closed this as completed May 31, 2019
@Urigo
Copy link
Collaborator

Urigo commented Mar 29, 2022

Hey, @Urigo from The Guild here!

You might know us from projects such as graphql-code-generator, envelop or graphql-tools.

For a long time we thought that the Javascript ecosystem is still missing a lightweight cross-platform, but still highly customizable GraphQL Server.

In the past the awesome Prisma team took on that great challenge and now we are happy to announce that we are continuing them and just released GraphQL Yoga 2.0 - Build fast, extensible, and batteries-included (Subscriptions, Serverless, File uploads support) GraphQL APIs in Node.js 🚀

And regarding the issue here, we also maintain the GraphQL Scalars library

We have been working a long time on version 2.0 and have been using it in our clients projects for a few months now and shared a couple of alpha cycles here.
Thank you all for your feedback and suggestions, you made this release possible!

Please try Yoga out again, give us feedback and help us spread the word on the new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/discussion Discussion, question or feedback
Projects
None yet
Development

No branches or pull requests

7 participants