opened
tinnou
username_0
Glitr scans domains however some domains might exist outside of the graph but we could still need them in the GraphQL schema.

Add GLiTR configuration time, offer the ability to add additional Java types for inspection.

Example:
For instance types A and B could implement an interface C that is discovered by GLiTR. Types A and B being never referenced elsewhere will not be inspected by GLiTR.
Have a way to add additional types that are outside of the visited domain graph
issue
created
tinnou
username_0
Here is an example on how to add types after initiation of the `Glitr` instance.

```
        Glitr glitr = GlitrBuilder.newGlitr()
                .withRelay()
                .withQueryRoot(new Viewer())
                .withMutationRoot(mutation)
                .withObjectMapper(configureGlitrObjectMapper())
                .build();
        // Man and Cyborg implement the Person interface but they haven't been discovered by GLiTR
        // we can ask for additional lookup
        glitr.getTypeRegistry().lookup(Man.class);
        glitr.getTypeRegistry().lookup(Cyborg.class);
        // make sure to reload the GraphQL Schema for the changes to take effect
        glitr.reloadSchema(Viewer.class, mutation.getClass());
```

See this [test](https://github.com/nfl/glitr/commit/851eda6a31e7b68a81afbf3db4b342371555dc18#diff-72b0c7662755b3a4b8379243cc511df4R13) for a full example.

As a side note, we could add the option to register additional types in the builder. We will come back to it in the future when needed.
comment
closed
tinnou
username_0
issue