vulcan-npm
vulcan-npm copied to clipboard
Unify syntax between queries and mutation
Current state:
- single will return
{ data: { foo : { result: <your-foo>}, result:}}` - multi will return
{ data: { foo : { results: <your-foo>}, results:}}` - create will return
{ data: { foo : { data: <your-foo>}, document:}}` - same for all other mutations
Proposal
- single will return
{ data: { foo : { document: <your-foo>}, document:}}` - multi will return
{ data: { foo : { documents: <your-foo>}, documents:}}` - create will return
{ data: { foo : { document: <your-foo>}, document:}}` - same for all other mutations
This way we use document as the canonical name for the object we are modifying ; we remove the confusing result name, and we use data only for generic data (eg the response of apollo query that contains both documents and metadata)
Steps
- [x] Unify the shortcut prop that contains the document (added client-side by the hook)
- [ ] Unify in Vulcan backend (defined server side in each resolver)
This needs a change in Vulcan Meteor too, because the structure of the response is defined there.