-
Notifications
You must be signed in to change notification settings - Fork 3
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
Namespace concept as in Braid #19
Comments
Hello, can you provide a very basic example? you can modify the basic example in our samples directory, So we can add support of namespaces. Thanks for the good feedback. |
Shall i quote the example here? So when merging Microservice 1 and Microservice 2 with schema names user1 and user2 respectively, now error occurs. Schema name can be used as a namespace and store the 2 queries in the merged schema. |
Ok. I'll examine it and get back to you. Thanks. |
Ok, I want to learn about your practical usage about this. I have tried with Atlassian braid. final String graphqlTypeDefinition = "type Query {\n" +
" user_get: String!\n" +
"}\n";
final Braid braid = Braid.builder()
.schemaSource(QueryExecutorSchemaSource.builder()
.namespace(SchemaNamespace.of("namespace1"))
.schemaLoader(new StringSchemaLoader(SchemaLoader.Type.IDL, graphqlTypeDefinition))
.localRetriever(new Function<Query, Object>() {
@Override
public Object apply(final Query query) {
return ImmutableMap.of("user_get1100", "admin");
}
})
.build())
.schemaSource(QueryExecutorSchemaSource.builder()
.namespace(SchemaNamespace.of("namespace2"))
.schemaLoader(new StringSchemaLoader(SchemaLoader.Type.IDL, graphqlTypeDefinition))
.localRetriever(new Function<Query, Object>() {
@Override
public Object apply(final Query query) {
return ImmutableMap.of("user_get1100", "user");
}
})
.build())
.build();
String query = "{user_get}";
final ExecutionResult result = braid.newGraphQL().execute(newExecutionInput().query(query).build()).join(); and getting |
In braid, there is a namespace concept. This will make possible to define graphql query with same name to be created in different microservices. Similarly, the schema in lilo should also considered while merging the graphql queries from different microservices.
Now a duplicate exception occurs if there are similar named queries in different microservices while merging the schema
The text was updated successfully, but these errors were encountered: