apollographql / apollographql/apollo-tooling

No SDL found in response from federated service.

Open
#2,245 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

I'm having an issue with pushing our federated schema to the schema registry.

I am trying to push the schema as part of our CI/CD using the command detailed [here](https://www.apollographql.com/docs/federation/managed-federation/setup/#2-register-all-implementing-service-schemas). I've tested the command and it works when we have the service running locally and we are using the `--endpoint` argument. However, we want to use the `--localSchemaFile` argument. Our service is in Python and we're using `graphene-federation`. In order to generate the schema file, we're using `graphene`'s [management command](https://docs.graphene-python.org/projects/django/en/latest/introspection/#graphql-sdl-representation) which outputs the schema to either `.json` or `.graphql` . When we provide the generated localSchemaFile in either format we get this error:

```
Error: No SDL found in response from federated service. This means that the federated service exposed a `__service` field that did not emit errors, but that did not contain a spec-compliant `sdl` field.
```

Here is the [schema.graphql](https://gist.github.com/Hilaryous/b2b7102515ff09c3bf22a3a321d7155e) and the [schema.json](https://gist.github.com/Hilaryous/6da5d8cb381a25646dc11ebfa0408df1) and here is the `apollo` cli command I am running:

```
npx apollo service:push
--graph={{ apollo_graph_name }}
--key={{ apollo_key }}
--variant=dev
--localSchemaFile=schema.graphql
--serviceName={{ service name }}
--serviceURL=http://{{service_url}}/graphql/

```

Seem like our schema is compliant to the spec, not sure what we're missing. Maybe it's an issue with how the schema file is generated?

Contributor guide

Open the contributing guide

Research direction

Start with the documented `apollo service:push` command and its `--localSchemaFile` handling, using the provided `schema.graphql` and `schema.json` as inputs. Compare both generated representations with the linked federation setup documentation and determine why the command reports no SDL; done means the supplied schema can be pushed without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python, typescript
Domain
api, cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.