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

argTypeMap no longer takes custom types #2881

Closed
ddcollins opened this issue Sep 29, 2021 · 1 comment
Closed

argTypeMap no longer takes custom types #2881

ddcollins opened this issue Sep 29, 2021 · 1 comment

Comments

@ddcollins
Copy link

ddcollins commented Sep 29, 2021

Describe the bug
In the old version of Mesh, we were defining a custom type via the base schema like so:

argTypeMap:
  id: ID!
  contentType: "ReciprocityContentType!"

However this isn't possible in the new version of Mesh. Nor does it seem that argTypeMap likes references to files:

argTypeMap:
  id: ID!
  contentType: ./src/json-schemas/reciprocity-api/base-schema.json#/definitions/ReciprocityContentType

(Tried in quotes too)

🕸️ - Server: Generating Mesh schema...
🕸️ - Server: TypeError[Query.reciprocityContent.contentType]: Syntax Error: Cannot parse the unexpected character ".".
error Command failed with exit code 1.

ReciprocityContentType is an enum type.

Is there a way I'm not seeing to do this?

Expected behavior
A file path can be provided to specify a custom type.

Environment:

"@graphql-mesh/cli": "^0.38.0",
"@graphql-mesh/graphql": "^0.18.10",
"@graphql-mesh/json-schema": "^0.18.3",
"@graphql-mesh/transform-naming-convention": "^0.6.60",
"@graphql-mesh/transform-resolvers-composition": "^0.10.10",

node:14.15-alpine

@theguild-bot theguild-bot mentioned this issue Aug 11, 2022
@ardatan
Copy link
Owner

ardatan commented Jan 18, 2023

https://the-guild.dev/graphql/mesh/docs/handlers/json-schema#manual-declare
The new API is documented here.
It supports references like;

contentType: 
   $ref: ./src/json-schemas/reciprocity-api/base-schema.json#/definitions/ReciprocityContentType

Feel free to create a new issue if it still persists.

@ardatan ardatan closed this as completed Jan 18, 2023
@theguild-bot theguild-bot mentioned this issue Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants