rover icon indicating copy to clipboard operation
rover copied to clipboard

apollo supergraph from folder

Open jmgaitan06 opened this issue 4 years ago • 2 comments

I have a go application that uses ent and graphql and I want to merge different graphql files into one using apollo rover but I don't want to list all the names of these files, how can I read these files from a specific folder?

jmgaitan06 avatar Sep 15 '21 20:09 jmgaitan06

You could create your config.yml with a script which will read files from folder and generate the input.

Little example for your use case a script generate_config.sh:

for file in $1
do
  echo "  $file:" >> 2
  echo "    routing_url: https://localhost:8888" >> $2
  echo "    schema:" >> $2
  echo "      file: ./$file" >> $2
done

and you run ./generate_config.sh *.graphql config.yml it'll generate a config file you can use for composing your supergraph.

Miaxos avatar Oct 05 '21 21:10 Miaxos

Currently experiencing this - Would Rover consider supporting a glob syntax or directory for the schema file attribute? Something like:

subgraphs:
  person:
    routing_url: https://my-person-service.com
    schema:
      file: ../persona-api/src/schemas/*.graphql

patrickwall57 avatar Nov 08 '21 21:11 patrickwall57