drizzle-graphql - buildSchema doesn't support `ApolloFederationDriver`
Context
I'm building a NestJS microservice application with GraphQL using
ApolloFederationDriver
. Its main components is:
1) A GQL federation gateway: as super-graph (left-handed side in the code snippet image) and this will connect to distributed schema in other subgraph microservices
2) Subgraph microservices: this will hold actuall schema of GQL in each microservice (mid and right-handed side) the GQL schema will be generated from drizzle buildSchema
function.
Currently, it seems to be not working with ApolloFederationDriver. Since when I try to access to the gateway playground, I can't see those scheme that generated from drizzle at all, just only my manual resolver appear there.
Please tell me if the buildSchema
function can work with ApolloFederationDriver
already.
Thank you 🙏21 Replies
@S. Reka can u confirm if my config is correct?
I've never used that tech stack or driver before, got to do further investigation. Could you provide an example of this issue in code format? That would make error reproduction much easier
Thanks for your response, may I give you the Github repository? To startup, you can just initialize the project by follwing README instruction
https://github.com/tung-dnt/microshop
GitHub
GitHub - tung-dnt/microshop
Contribute to tung-dnt/microshop development by creating an account on GitHub.
That should work, investigating
May take a while, having trouble getting your repo to work
Thanks for your effor
Do you have any idea what might cause this in
pnpm init:dev
script?And this happens in the docker image that it creates, not sure what's going on here
but either way I can't get to the menus that are in your screenshots
letme update start up shell script
maybe your machine doesn't support the syntax
That might be the case since I'm using WSL
@S. Reka can you pull the latest commit and try again?
because gateway container will connection to product container to retrieve its graphql schema, if product container isn't up at port 3000, then gateway container can't connect to product
Nope, same thing
I'll try to set up my own repo using the stack you use if I'll fail to start this one, will message you once I've found anything. For now, can you log what the buildSchema returns in
entities
? If everything is alright there, I'm going to have to resolve the issue with this particular library it seems.Okay, i’ll log both schema and entities
here's
entities
here's
schema
I think this is just the problem with schema compatibility
Yeah, since entities and schema are in an expected shape, I'd say there's something to this library I don't know about, thanks for the logs, I'll try to fix it ASAP if that's possible.
Thank you, that's a huge effort
how can i buy you a coffee?
Oh, don't worry about that, and I prefer tea anyways! If you want to do it anyways though, just go to drizzle team sponsorships
Well, I've managed to finally get that script running, but now I'm getting something else:
As far as I understand the second error might be the reason your schema gets lost in process, since graphql server tries to fetch it from a non-existing source