Comments (3)
You could change:
if(!Date.parse(ast.value)) {
throw new GraphQLError('Query error: String is not a valid date time string', [ast]);
}
to
if(isNaN(Date.parse(ast.value))) {
throw new GraphQLError('Query error: String is not a valid date time string', [ast]);
}
References:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
- http://stackoverflow.com/questions/1353684/detecting-an-invalid-date-date-instance-in-javascript
from graphql-custom-types.
#6 fixes your issues and has tests to confirm.
from graphql-custom-types.
@Glavin001 Thank you.
from graphql-custom-types.
Related Issues (13)
- Peer dependencies HOT 1
- parser shallowing up errors HOT 2
- Question: Is there a way to reference these types in a graphql file? HOT 1
- Add additional types HOT 6
- peerDependency warning HOT 3
- Compatibility with graphql 0.13.x
- Serialize is happy to serialize invalid URLs (and probably other invalid types too) HOT 1
- Is possible to use custom types outside of javascript? HOT 3
- GraphQLPassword typescript error HOT 2
- Compatibility with graphql 15.x HOT 2
- field type must be Output Type but got: Email HOT 4
- GraphQL Error: "Query.contact(email:) argument type must be Input Type but got: Email" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-custom-types.