Comments (6)
Thanks for replying and sorry for not checking this in graphql-js first.
I ended up moving the validation to the User model (Mongoose) and throwing any validation errors in the resolve function for the mutation. I could then also remove my custom Email scalar and just use the String scalar. Less files! :)
from apollo-server.
Hi @richardkall, could you do me a favor and verify that the behavior is different if you use just graphql-js on its own? If I remember correctly, graphql-js doesn't use parseLiteral on variables, because variables are already parsed as JSON. If you want to do validation, I think your only choice is to do so inside the resolve functions.
from apollo-server.
@helfer , I copied and pasted the Date
example from apollo docs and it didn't work. As stated above, __parseLiteral
is not being called.
from apollo-server.
@sammkj: As I stated above, I think that's how graphql-js works.
See also:
graphql/graphql-js#187
from apollo-server.
Ah I see. Thanks for the reference!
from apollo-server.
@richardkall can't you use _parseValue
for this? That's the equivalent of _parseLiteral
for variables..
from apollo-server.
Related Issues (20)
- Bun integration on subscription (Query and Mutation Works, but not Subscription) HOT 3
- TypeSafe Custom GQLError HOT 2
- support for fastify version 4 HOT 2
- Allow passing http2 server to ApolloServerPluginDrainHttpServer
- ApolloServerPluginUsageReporting reportTimer has incorrect type HOT 1
- Elasticache cluster - CROSSLOT Keys in request don't hash to the same slot HOT 4
- Unable to package/deploy with serverless using Node14 and apollo-serverless-core HOT 3
- ApolloServerPluginUsageReporting does not allow to pass http agent HOT 11
- Misconfigured `sendVariableValues` results in similar behavior as `{all: true}` HOT 3
- ApolloServerPluginUsageReporting does not allow to pass http agent HOT 2
- Apis that have their requests cached dont need to make unnecessary auth token fetches
- Document known mitigated security issue in `@koa/cors` for AS3 users HOT 1
- Update `@koa/cors` dependency for AS3 (or why we don't intend to) HOT 2
- Share and modify variables between Express and the GraphQL/Apollo server HOT 1
- Error: ApolloServer<BaseContext>' is not assignable to type 'ApolloServer<ExpressContext> HOT 3
- callback function for onSchemaLoadOrUpdate when upgrading from AS v3 to AS v4 HOT 3
- Allow plugins to throw meaningful GraphQL errors
- Getting started tutorial has typescript issues...
- Delay when subscription is closed on client side of the router when using callback
- Documentation and dynamic cache control feature of Apollo leverages incompatible GraphQl type interface. HOT 3
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 apollo-server.