Skip to content

[Subgraphs] - Using multiple query fields with different name per subgraph #1004

Answered by 2snEM6
2snEM6 asked this question in Q&A
Discussion options

You must be logged in to vote

So what I did is make sure the schema is built before reusing the builder again. Then, creating a function that does this:

  removeQueriesAndMutations(): this {
    this.configStore.typeConfigs.forEach((typeConfig) => {
      if (typeConfig.kind === 'Query' || typeConfig.kind === 'Mutation') {
        this.configStore.typeConfigs.delete(typeConfig.name);
      }
    });

    this.queryType({
      subGraphs: [...SUBGRAPHS],
      defaultSubGraphsForFields: [],
    });

    this.mutationType({
      subGraphs: [...SUBGRAPHS],
      defaultSubGraphsForFields: [],
    });

    const queryFields = this.configStore.getFields('Query', 'Object');
    queryFields.forEach((field) => {
      queryF…

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@hayes
Comment options

@2snEM6
Comment options

@hayes
Comment options

@2snEM6
Comment options

Answer selected by 2snEM6
@hayes
Comment options

@2snEM6
Comment options

@2snEM6
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants