Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Conditional stitching to specific datasources #66

Open
kbrandwijk opened this issue Dec 23, 2017 · 0 comments
Open

Conditional stitching to specific datasources #66

kbrandwijk opened this issue Dec 23, 2017 · 0 comments

Comments

@kbrandwijk
Copy link
Member

I have been thinking about scenarios to use stitching on the GrAMPS-level, and the only use case I can come up with is when I want to stitch to another datasource. However, to keep datasources as independent as possible, I would like to add the feature to:

  • Specify which datasource I want to stitch to (based on its unique namespace)
  • Only apply that stitching if the datasource is part of my collection of datasources

To achieve this, I propose adding a key to the stitching object like this:

context: 'myDatasource',
model: ...,
schema: ...,
resolvers: ...,
stitching: {
  xckd: {
    typeDefs: ...,
    resolvers: ...
  },
  myOtherDatasource: {
    typeDefs: ...,
    resolvers: ...
  }
}

So if I setup my GrAMPS like this:

const gramps = gramps({ datasources: [myDatacource, xckd] })

That only the stitching on myDatasource to xckd is applied, and not to myOtherDatasource, because those types, and that data, is not available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant