-
Notifications
You must be signed in to change notification settings - Fork 3
Add recordEdge to mutation payloads #1
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
Comments
Is it easy to implement this feature? Do you have plan to implement it? Could you give us a guideline to implement it if you have no time? |
No, I have not plan to implement it, cause does not use But with pleasure share ideas how it should be implemented. Before, let look on what is it
So the most tricky part is determining correct The code will look something like this: UserTC.get('$createOne').getTypeComposer().setField('nodeEdge', {
args: {
sort: UserTC.get('$connection.@sort'),
},
type: UserTC.get('$connection.edges'),
resolve: (source, args, context, info) => {
// PREPARE `node`
// console.dir(source, { depth: 4, color: true });
const node = source.record;
// PREPARE `cursor`
// console.dir(args, { depth: 4, color: true });
// see how constructed cursor https://github.com/nodkz/graphql-compose-connection/blob/master/src/connectionResolver.js#L190
const cursor = ...;
return {
cursor,
node
};
},
}); |
If detected
connection
resolver, thencomposeWithRelay
should addnodeEdge(sort: SortType)
field to payload, for passing it toRANGE_ADD
on the client mutation config. Right now this wrapper does not allow to do it out of the box.The text was updated successfully, but these errors were encountered: