-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Federation with custom mappers #5646
Comments
I am facing a similar problem. I think the problem is in this line: |
This is totally related to #4724 . Please note that @kamilkisiela is doing some work at the moment to improve the integration with Federation (see #5645) |
Also running into this, GraphQLRecursivePick<> type is looking at my mapped classes, and they don't have the schema that's in @keys on purpose. For example, I have a schema like
I have mapped types named MyAttribute and MyNamespace that look like
I have to modify MyAttribute to look like:
For the reference resolver to work. It's a bit annoying and I may have to disable federation in that plugin and try to write my own plugin to compensate (I don't even know if it's possible to modify the output of the typescript plugin with another plugin, haven't checked) |
These types come over from other servers, and so should use types from the output, not the internal side of the resolvers. Fixes dotansimha#5646
Is your feature request related to a problem? Please describe.
Hello, i'm using codegen in a federated project with custom mappers.
On db side my "id" field is _id (i'm using mongo) so i set up the db instance like this
In schema:
And in codegen i added this class as a mapper
But this is generating for user resolver
So in this line
__resolveReference?: ReferenceResolver<Maybe<ResolversTypes['User']>, { __typename: 'User' } & GraphQLRecursivePick<ParentType, {"id":true}>, ContextType>;
is searching "id" inside UserDb interface which is not present because in my interface is called "_id"Is this customizable? Thank you!
The text was updated successfully, but these errors were encountered: