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

Question about schema description #32

Open
simbo1905 opened this issue May 6, 2024 · 0 comments
Open

Question about schema description #32

simbo1905 opened this issue May 6, 2024 · 0 comments
Assignees

Comments

@simbo1905
Copy link

Given:

Slf4j
@Controller
public class Router {
  private final Lilo lilo;

  public Router() {
    this.lilo = Lilo.builder()
        .addSource(RemoteSchemaSource.create("server1", "http://localhost:8081/graphql"))
        .addSource(RemoteSchemaSource.create("server2", "http://localhost:8082/graphql"))
        .build();
    log.info("Router created");
  }

  @ResponseBody
  @PostMapping("/graphql")
  public Map<String,Object> stitchedSchema(@RequestBody GraphQLRequest input){
    log.info("Router.stitchedSchema() called");
    return this.lilo.stitch(input.toExecutionInput()).toSpecification();
  }
}

When I query with:

{
  __typename
  __schema {
    description
  }
}

Then I get back:

{
  "data": {
    "__typename": "Query",
    "__schema": {
      "description": null
    }
  }
}

How do I set the __schema.description so that I can add some information visible to clients about the scope/nature/sources of the stitched schema which will be very helpful when adding lots of sources across different environments/profiles?

@firatkucuk firatkucuk self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants