friatech / lilo

Lilo is a super-fast, easy-to-use, configurable GraphQL stitching library
Apache License 2.0
38 stars 3 forks source link

Question about schema description #32

Open simbo1905 opened 7 months ago

simbo1905 commented 7 months ago

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?