-
Notifications
You must be signed in to change notification settings - Fork 349
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
@graphql-mesh/transform-filter-schema prevents creation of index.d.ts #3523
Comments
Sounds similar to #3367 |
I think so yes, though in my use case I do not need to SDK only the types. I read your comment about applying the transform at the source instead of at the root. That was enough to fix my reported issue, which is enough for my use case. For anyone experiencing the same situation as me, you can apply the transform at the source handler level instead of at the root, like this: sources:
- name: Wiki
handler:
openapi:
source: https://api.apis.guru/v2/specs/wikimedia.org/1.0.0/swagger.yaml
operationIdFieldNames: true
transforms:
- filterSchema:
mode: bare
filters:
- Query.!{getMediaMathFormulaHash} |
Seems to be fixed in the latest version. Let us know if the issue persists. |
Describe the bug
The command
mesh build
is unable to generate a type definition fileindex.d.ts
when the transform@graphql-mesh/transform-filter-schema
is used to filter queries or mutations generated by the source Open API, Mongoose, and possibly other source handlers. Although, I've noticed that queries or mutations generated viaadditionalTypeDefs
option can be filtered without issues. The bug can be seen when the following transform is added:getMediaMathFormulaHash
comes from the Open API source handler. However, that query is not specifically causing the issue, nor the Open API source handler. I've tried a number of combinations of queries and source handlers, and they all seem to experience the same bug. I have also tried withwrap
mode and the same issue persists.To Reproduce
Here is a repository with the minimum setup to reproduce the bug https://github.com/leonsomed/graphql-mesh-transform-types-bug.
yarn install
yarn build
.mesh
does not contain a type definition fileindex.d.ts
(This is the reported bug)filterSchema
from.meshrc.yaml
yarn build
index.d.ts
is correctly created in directory.mesh
Expected behavior
A type definition file
index.d.ts
should be generated when runningmesh build
regardless of the transforms or source handlers used.Environment:
package.json
Additional context
Since this bug prevents the types from being generated, it is impossible to use the
Resolvers
type when working with typescript and using theadditionalResolvers
option.The text was updated successfully, but these errors were encountered: