Error: Could not parse supergraph config: subgraphs.course_query: data did not match any variant of untagged enum SchemaSource at line 4 column 16

I am on Ubuntu OS and I am using rover CLI to generate a supergraph from my subgraphs, and when I type the command

rover supergraph compose --config ./supergraph-config.yaml

It throws an error as:-

error: Could not parse supergraph config: subgraphs.course_query: data did not match any variant of untagged enum SchemaSource at line 4 column 16.

My supergraph-config.yaml is as given below

federation_version: 2
subgraphs:
  course_query:
    routing_url: location/where/endpoints/of/subgraph/are/
    schema:
      subgraph_url: location/of/subgraph/
  user_manager:
    routing_url: location/where/endpoints/of/subgraph/are/
    schema:
      subgraph_url: location/of/subgraph/

I am following the tutorial of https://www.apollographql.com/ about making supergraph from subgraphs, and my subgraphs are correct. I have already tried generating a new API key and authenticating it with that.

If I use rover subgraph list graphname@variantname then it does show all the subgraphs, so that is also not the issue.

Can anyone help me to find out where is my error, and rectify it??

Thanks in advance

1 Like

I have faced the same issue.
As you can see in the rover documentation Rover supergraph commands - Apollo GraphQL Docs
when you want to parse the subgraph schema from a local file you have to use the directive “file” instead of “subgraph_url”

Your config file should be :

federation_version: 2
subgraphs:
  course_query:
    routing_url: location/where/endpoints/of/subgraph/are/
    schema:
      file: location/of/subgraph/
  user_manager:
    routing_url: location/where/endpoints/of/subgraph/are/
    schema:
      file: location/of/subgraph/