Skip to content
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

Feature: Ability to use a responseModifier for GraphQL push replication #4385

Conversation

leonceaklin
Copy link
Contributor

This PR contains:

  • New feature that lets you define a responseModifier for GraphQL push replication to be able to covert any response to the format required by RxDB to detect conflicting documents
  • New feature that lets you define a dataPath for the conflicting documents in a GraphQL push replication

Describe the problem you have without this PR

  • It's not possible to use RxDB with an advanced GraphQL setup where the server returns more than an array of conflicting documents on push replication

Todos

  • Tests
  • Documentation
  • Typings
  • Changelog

}
```

```js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 'ts' instead of 'js' because your code below contains typings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I also changed it for the example of the pull.responseModifier now.

/**
* In this example we aggregate the conflicting documents from a response object
*/
const pullResponse = plainResponse;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldnt this variable be called 'pushResponse' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops… it's unused anyway, so I removed it.

- Changed from 'js' to 'ts' in code blocks that explain "pull.responseModifier" and "push.responseModifier"
- Removed unused variable definition with wrong name
@pubkey pubkey merged commit 080a68a into pubkey:master Feb 2, 2023
pubkey added a commit that referenced this pull request Feb 2, 2023
@pubkey
Copy link
Owner

pubkey commented Feb 2, 2023

Great work. Merged.

@leonceaklin
Copy link
Contributor Author

Thanks 🙏 :)

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

Successfully merging this pull request may close these issues.

2 participants