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
[Help] Using FilterRootFields and delegateToSchema() #1103
Comments
Try removing the indicated line above. You are including the schema pre-transformation schema in the list of merged schemas, so anything filtered out is still included. In terms of filtering out specific fields of objects, that has been requested in #819, you could track that. More tedious, but perhaps more practical, you could define a new AuthToken type which manually redefines all the fields except the ones you want to filter out, I think depending on the order included within mergeSchemas, your new type may win out, but I have to test out how that works now that |
From my testing, looks like whatever is last wins, so you would just change
to:
I would also rename |
@yaacovCR Thanks for all your help! I took your advice and it works perfectly.
|
I'm trying to use
FilterRootFields()
as one of my 'transforms' on adelegateToSchema()
method. The schema delegation works fine however the filter isn't being applied to remove the 'userById' query from the graph. I also need to remove the 'userId' field from the 'AuthToken' type.// userSchema.ts
// authTokenSchema.ts
// schema.ts
The text was updated successfully, but these errors were encountered: