Created
January 28, 2022 14:33
-
-
Save paolochiodi/93a75b1b1cd551a745b6d8d77f83e1a4 to your computer and use it in GitHub Desktop.
Repro for mercurius-validation nullable types issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Fastify = require('fastify') | |
const mercurius = require('mercurius') | |
const mercuriusValidation = require('mercurius-validation') | |
const assert = require('assert') | |
const app = Fastify() | |
const schema = ` | |
type Query { | |
test(in: String): String | |
} | |
` | |
const resolvers = { | |
Query: { | |
test: async (_, args) => { | |
assert(args.in === null) | |
return 'it works' | |
} | |
} | |
} | |
app.register(mercurius, { | |
schema, | |
resolvers | |
}) | |
app.register(mercuriusValidation) | |
app.listen(3210) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test-graphql", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"fastify": "^3.27.0", | |
"graphql": "^15.8.0", | |
"mercurius": "^8.12.0", | |
"mercurius-validation": "^1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment