Replies: 1 comment 1 reply
-
If exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions
const typeDefs = `
type hasura_parties implements Node {
idToString: String
}
`
createTypes(typeDefs)
}
exports.createResolvers = ({ createResolvers }) => {
createResolvers({
hasura_parties: {
idToString: {
type: "String",
resolve: source => source.id.toString(),
},
},
})
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Preliminary Checks
Description
Trying to customize a Hasura GraphQL Type, following the Schema Customization API guide, throws the error:
Error: Schema must contain uniquely named types but contains multiple types named "hasura_parties".
Reproduction Link
https://github.com/ccalvarez/hasura-type-custom
Steps to Reproduce
hasura-type-custom
npm install
to install dependenciesgatsby develop
Expected Result
The gatsby site 'hello-world' started
Able to query the hasura.parties list, including the new field
idToString
, via GraphiQL with this GraphQL query:query MyQuery { hasura { parties { id name idToString } } }
Actual Result
Missing onError handler for invocation 'building-schema', error was 'Error: Schema must contain uniquely named types but contains multiple types named "hasura_parties".'.
Environment
Config Flags
I don't use any flag.
Beta Was this translation helpful? Give feedback.
All reactions