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

Resolvers not getting merged #2219

Closed
nemonemi opened this issue May 26, 2021 · 10 comments
Closed

Resolvers not getting merged #2219

nemonemi opened this issue May 26, 2021 · 10 comments
Labels
stage/1-reproduction A reproduction exists

Comments

@nemonemi
Copy link
Contributor

nemonemi commented May 26, 2021

In the example below, only the type gets merged correctly, but not the resolvers. Only one service gets resolved, I believe in a random fashion.

The Authors service defines only the id and name on the Author type:

type Query {
  authors: [Author!]!
  author(id: ID!): Author!
}

type Author {
  id: ID!
  name: String!
}

The Books service is extending the Author type with its own model and data:

type Query {
  books: [Book!]!
  book(id: ID!): Book!
  author(id: ID!): Author!
}

type Book {
  id: ID!
  title: String!
}

type Author {
  id: ID!
  books: [Book!]!
}

To Reproduce

  1. go to the sandbox
  2. if the service doesn't start or shows 502, go to the Server Control Panel on the left, and restart the server
  3. gateway starts on the port 4000
  4. execute the prepopulated query Author
  5. observe the error:
  6. Either the name property or the books property will be missing.

Also, here's the Github repo:
https://github.com/nemonemi/graphql_ensemble/tree/testing-federation-kind-of-approach

Expected behavior
I'm expecting both the types and the resolvers to be merged, and when the Author query is executed that both the name and the books properties are resolved.

Additional context
I'm not sure if this model workflow should already be supported, or if this is a feature request.

@nemonemi
Copy link
Contributor Author

nemonemi commented May 30, 2021

@dotansimha, @ardatan how can I assist you guys in any way in progressing with this issue?

@Urigo Urigo added the stage/1-reproduction A reproduction exists label May 31, 2021
@Urigo
Copy link
Collaborator

Urigo commented May 31, 2021

Hi @nemonemi and thank you for the report

Sorry but I'm not adding a lot here but just labeling it according to our new Contribution Guide and issue flow.

It seems already got into stage 1 thanks to your reproduction! Thank you for that!

Now in order to advance to stage 2 we'll need a failing test, would be great if someone could help progress the issues through the stages.

Thank you and sorry that this comment is not a complete solution (yet).

@nemonemi
Copy link
Contributor Author

nemonemi commented Jun 1, 2021

I would be willing to do it, but due to the lack of time on my part, I'd appreciate a point in the right direction. Which library is responsible, that the tests should be added?

@Urigo
Copy link
Collaborator

Urigo commented Jun 1, 2021

looks like you should check GraphQL Tools first

@yaacovCR
Copy link

yaacovCR commented Jun 1, 2021

#1833

@nemonemi
Copy link
Contributor Author

@ardatan
I have tested the latest libraries' versions, but nothing has changed in terms of behavior.
Still, the type gets merged correctly, but the resolvers not.

Either one resolver gets applied, or the other.

@ardatan
Copy link
Owner

ardatan commented Jun 17, 2021

@nemonemi In Type Merging, you need to do some small definitions.
We're currently working on it on this PR/branch;
https://github.com/Urigo/graphql-mesh/blob/refactor/packages/transforms/type-merging/yaml-config.graphql

I created an example with alpha versions;
https://codesandbox.io/s/inspiring-platform-4j2ki?file=/.meshrc.yml
I think that's what you're looking for.

@nemonemi
Copy link
Contributor Author

Hi Arda,
thanks for the info, I'll check it out and test it, hopefully soon.

@nemonemi
Copy link
Contributor Author

nemonemi commented Dec 19, 2021

Hello @ardatan,
I have come to a point to deal with this again as we are on the way to requiring a gateway solution by increasing the number of our services.

Thank you for the example. I can confirm that in your codesandbox it works, however, I have tried to map it to my repo without success. The steps applied are just not clear enough to deduce what is important, and the documentation is not much better.

Could you please help me out reason about what actually needs to be applied here to make this work?

https://codesandbox.io/s/graphql-ensemble-nx-iz6vm

p.s. in the Codesandbox' Server control panel open the screen with port 5000 to access the gateway in question.

@nemonemi
Copy link
Contributor Author

nemonemi commented Apr 12, 2022

I have to say, I am pretty disappointed in how these tickets get addressed, let alone resolved.

I have managed to get this to work, but have encountered another issue that is simply not possible to resolve using documentation or existing tickets.

Although I have had high hopes for applying graphql-mesh to several places in my company, this kind of inattentiveness caused me to become demoralized to use this library.

@theguild-bot theguild-bot mentioned this issue Aug 11, 2022
@ardatan ardatan closed this as completed Mar 31, 2023
@theguild-bot theguild-bot mentioned this issue Sep 28, 2023
This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/1-reproduction A reproduction exists
Projects
None yet
Development

No branches or pull requests

4 participants