neo4j-graphql-js icon indicating copy to clipboard operation
neo4j-graphql-js copied to clipboard

Any possibility of allowing multiple data sources soon?

Open partounian opened this issue 4 years ago • 6 comments

I noticed it was in the goals, I'm beginning a new project and would love to consider neo4j rather than mongodb but don't want to have to create separate APIs that could more easily be RESTDataSources.

partounian avatar Jul 08 '19 23:07 partounian

What I do is combine both with Federation, but then you cannot use an augmented schema.

Pruxis avatar Jul 09 '19 06:07 Pruxis

Hey @partounian - currently you can add additional data sources by implementing those resolvers yourself. Just be sure to exclude any types that are not fetched in Neo4j either using the config or adding the @neo4j_ignore directive to exclude these types from the generated Cypher queries.

johnymontana avatar Jul 09 '19 16:07 johnymontana

Awesome! So I could use augmentedSchema, and an exclude any non-neo4j types?

Perfect.

On Tue, Jul 9, 2019, 9:55 AM William Lyon [email protected] wrote:

Hey @partounian https://github.com/partounian - currently you can add additional data sources by implementing those resolvers yourself. Just be sure to exclude any types that are not fetched in Neo4j either using the config https://grandstack.io/docs/graphql-schema-generation-augmentation.html#configuring-schema-augmentation or adding the @neo4j_ignore directive to exclude these types from the generated Cypher queries.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/neo4j-graphql/neo4j-graphql-js/issues/276?email_source=notifications&email_token=AATMQG56SREU5V7EEA4VQNDP6S7HDA5CNFSM4H7AGP5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQ36QY#issuecomment-509722435, or mute the thread https://github.com/notifications/unsubscribe-auth/AATMQG2KKE5BOTXW2W73OT3P6S7HDANCNFSM4H7AGP5A .

partounian avatar Jul 09 '19 16:07 partounian

You could also use schema forwarding, forwarding your Neo4j schema privately and then stitch them together and expose that publicly as your GraphQL api. The Neo4j bits will be taken care of by Neo4j-graphql and the other bits will be taken care of by whatever other service. You could have these all on the same instance to make network overhead zero.

benjamin-rood avatar Jul 09 '19 17:07 benjamin-rood

@benjamin-rood Is there an example anywhere of the schema forwarding technique you describe? Very interested in federation w/ neo4j

bwalsh avatar Feb 19 '20 19:02 bwalsh

https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608

michaeldgraham avatar May 02 '21 04:05 michaeldgraham