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

Apollo Server failed to start with latest version #449

Closed
rkudryashov opened this issue Mar 20, 2021 · 5 comments
Closed

Apollo Server failed to start with latest version #449

rkudryashov opened this issue Mar 20, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@rkudryashov
Copy link

Expected Behavior

Apollo Server starts successfully

Actual Behavior

Apollo Server prints:

[nodemon] starting `node gateway.js`
🚀 Server ready at http://0.0.0.0:4000/
This data graph is missing a valid configuration. [planets-service] Subscription -> `Subscription` is an extension type, but `Subscription` is not defined in any service

Steps to Reproduce the Problem

  1. https://github.com/rkudryashov/graphql-rust-demo can be used as reproducer
  2. Change async-graphql version to the latest
  3. Start apollo-server

My suggestion is that was caused by changing _server.sdl response: previous versions return:

{
  "data": {
    "_service": {
      "sdl": "type Query {\n\tgetPlanets: [Planet!]!\n\tgetPlanet(id: ID!): Planet\n}\ntype Planet @key(fields: \"id\") {\n\tid: ID!\n\tname: String!\n\t\"\"\"\n\tFrom an astronomical point of view\n\t\"\"\"\n\ttype: PlanetType!\n\tisRotatingAroundSun: Boolean!\n\tdetails: Details!\n}\nenum PlanetType {\n\tTERRESTRIAL_PLANET\n\tGAS_GIANT\n\tICE_GIANT\n\tDWARF_PLANET\n}\ninterface Details {\n\tmeanRadius: BigDecimal!\n\tmass: BigInt!\n}\ntype InhabitedPlanetDetails implements Details {\n\tmeanRadius: BigDecimal!\n\tmass: BigInt!\n\t\"\"\"\n\tIn billions\n\t\"\"\"\n\tpopulation: BigDecimal!\n}\nscalar BigDecimal\nscalar BigInt\ntype UninhabitedPlanetDetails implements Details {\n\tmeanRadius: BigDecimal!\n\tmass: BigInt!\n}\ntype Mutation {\n\tcreatePlanet(planet: PlanetInput!): Planet!\n}\ninput PlanetInput {\n\tname: String!\n\ttype: PlanetType!\n\tdetails: DetailsInput!\n}\ninput DetailsInput {\n\t\"\"\"\n\tIn kilometers\n\t\"\"\"\n\tmeanRadius: BigDecimal!\n\t\"\"\"\n\tIn kilograms. A number should be represented as, for example, `6.42e+23`\n\t\"\"\"\n\tmass: BigInt!\n\t\"\"\"\n\tIn billions\n\t\"\"\"\n\tpopulation: BigDecimal\n}\n"
    }
  }
}

latest version returns:

{
  "data": {
    "_service": {
      "sdl": "type Query {\n\tgetPlanets: [Planet!]!\n\tgetPlanet(id: ID!): Planet\n}\ntype Planet @key(fields: \"id\") {\n\tid: ID!\n\tname: String!\n\t\"\"\"\n\tFrom an astronomical point of view\n\t\"\"\"\n\ttype: PlanetType!\n\tisRotatingAroundSun: Boolean!\n\tdetails: Details!\n}\nenum PlanetType {\n\tTERRESTRIAL_PLANET\n\tGAS_GIANT\n\tICE_GIANT\n\tDWARF_PLANET\n}\ninterface Details {\n\tmeanRadius: BigDecimal!\n\tmass: BigInt!\n}\ntype InhabitedPlanetDetails implements Details {\n\tmeanRadius: BigDecimal!\n\tmass: BigInt!\n\t\"\"\"\n\tIn billions\n\t\"\"\"\n\tpopulation: BigDecimal!\n}\nscalar BigDecimal\nscalar BigInt\ntype UninhabitedPlanetDetails implements Details {\n\tmeanRadius: BigDecimal!\n\tmass: BigInt!\n}\ntype Mutation {\n\tcreatePlanet(planet: PlanetInput!): Planet!\n}\ninput PlanetInput {\n\tname: String!\n\ttype: PlanetType!\n\tdetails: DetailsInput!\n}\ninput DetailsInput {\n\t\"\"\"\n\tIn kilometers\n\t\"\"\"\n\tmeanRadius: BigDecimal!\n\t\"\"\"\n\tIn kilograms. A number should be represented as, for example, `6.42e+23`\n\t\"\"\"\n\tmass: BigInt!\n\t\"\"\"\n\tIn billions\n\t\"\"\"\n\tpopulation: BigDecimal\n}\ntype Subscription {\n\tlatestPlanet: Planet!\n}\n"
    }
  }
}

(it contains subscription definition)

@rkudryashov rkudryashov added the bug Something isn't working label Mar 20, 2021
@rkudryashov
Copy link
Author

rkudryashov commented Mar 20, 2021

I've found your new project: https://github.com/async-graphql/graphgate - this is very good news

What is the production readiness level of that library? Does it outperform Apollo Server?

Did you stop Apollo Server support?

@sunli829
Copy link
Collaborator

I've found your new project: https://github.com/async-graphql/graphgate - this is very good news

What is the production readiness level of that library? Does it outperform Apollo Server?

Did you stop Apollo Server support?

Sorry, I forgot that Apollo Federation does not support subscription, I will add an option.

GraphGate may have some bugs because it has not been fully tested. 🙂

@sunli829
Copy link
Collaborator

I've found your new project: https://github.com/async-graphql/graphgate - this is very good news
What is the production readiness level of that library? Does it outperform Apollo Server?
Did you stop Apollo Server support?

Sorry, I forgot that Apollo Federation does not support subscription, I will add an option.

GraphGate may have some bugs because it has not been fully tested. 🙂

I found your demo project, if you want, you can switch Apollo Server to GraphGate. 🙂

https://github.com/rkudryashov/graphql-rust-demo

@rkudryashov
Copy link
Author

I will add an option.

Thanks, that works

I found your demo project, if you want, you can switch Apollo Server to GraphGate. 🙂

I'll definitely try it. Are you planning to publish a crate of that library?

@sunli829
Copy link
Collaborator

I need to improve it before publishing to crates.io. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants