lilo icon indicating copy to clipboard operation
lilo copied to clipboard

Question about schema description

Open simbo1905 opened this issue 1 year ago • 0 comments

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?

simbo1905 avatar May 06 '24 14:05 simbo1905