-
Notifications
You must be signed in to change notification settings - Fork 146
Feature request: makeAugmentedSchema and Apollo's buildFederatedSchema integration support #260
Comments
Yes, this is definitely something we'll need to look into. I have it on my list to research. |
Hey @emregency I got this working but without the generated queries and mutations (which is our desired use case) You can just import the directives like this import { cypherDirective, relationDirective } from 'neo4j-graphql-js/dist/utils';
const server = new ApolloServer({
schema, // This is your federated schema.
schemaDirectives: [{ cypher: cypherDirective, relation: relationDirective }],
context: (): Context => ({ driver }),
playground: true,
introspection: true,
});
// Sample resolvers
import { neo4jgraphql } from 'neo4j-graphql-js';
const resolvers = {
Query: { test: neo4jgraphql }
} |
Hey,
Thanks a lot for your contributions to the library. I use the mutations as they are convenient for the development phase. I prefer to have all of them as we build the front end. For sure, after certain point I would only use the directives.
Cheers!
… On 3. Jul 2019, at 10:29, Laurens Lavaert ***@***.***> wrote:
If you don't want the complete shebang of having automaticly generated Mutations & Queries, then I think exposing the directives should be good enough.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hey!
I saved this in a corner. Thanks a lot!
… On 3. Jul 2019, at 13:10, Laurens Lavaert ***@***.***> wrote:
Hey @emregency I got this working but without the generated queries and mutations (which is our desired use case)
You can just import the directives like this
import { cypherDirective, relationDirective } from 'neo4j-graphql-js/dist/utils';
const server = new ApolloServer({
schema,
schemaDirectives: [{ cypher: cypherDirective, relation: relationDirective }],
context: (): Context => ({ driver }),
playground: true,
introspection: true,
});
// Sample resolvers
import { neo4jgraphql } from 'neo4j-graphql-js';
const resolvers = {
Query: { test: neo4jgraphql }
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@emregency also check #283 |
I'm interested, after the last PR, what the remaining clashes are between makeAugmentedSchema and buildFederatedSchema are? e.g. does it clash with one of mutations, filters, ordering specifically, or is it to do with something more fundamental in how makeAugmatedSchema works |
Hi @Pruxis, thanks for posting your solution. I tried it but couldn't make it work with buildFederatedSchema. I keep getting these errors: But it works perfectly fine if I remove all the @cypher and @relation directives. Here's my code:
|
Okay, the problem was coming from the schema itself. Just adding the directives that I found in the generated schema of makeAugmentedSchema to the schema and it works.
|
Hell all. Newbie question. Just started experimenting with grandstack + apollo federation. Is there a canonical example on how this should work? |
I second @bwalsh 's request. Could someone please point towards documentation on how this can be used? It's quite unclear at the moment. My usecase is that i need federation because one graphql service handles some domain business logic, and the neo4j data is handled by a separate service. Thanks :) |
i would love to be able to use the augmented schema with Apollo federation. without federation support, i can only (barely/awkwardly) use your directives. :( |
Hi everyone! We recently updated with support for using Apollo Federation & Gateway. You can check out a guide added to the documentation here. I didn't notice to reference this issue in the recent PR, but it is now. :) |
Thanks very much. Looking forward to trying this soon. |
Typically,
Types may have different attributes that are requiring other dB/service access than neo4j i.e. profile photos for User where the link is stored in neo4j db and the image itself somewhere else (a recommended practice by neo4j). In such cases, stitching schemas to different services is required but is quite painful.
The new release of Apollo Federation provides a very convenient way to manage these multi service API design.
However,
The implementation requires the developer to augment the schema with a new method called
buildFederatedSchema
where new directives for managing easily the interdependence among schemas are introduced :as illustrated here.
Is it possible to concatenate or provide an elegant way of enabling
makeAugmentedSchema
andbuildFederatedSchema
?The text was updated successfully, but these errors were encountered: