vulcan-npm icon indicating copy to clipboard operation
vulcan-npm copied to clipboard

Unify syntax between queries and mutation

Open eric-burel opened this issue 5 years ago • 1 comments

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)

eric-burel avatar Sep 28 '20 16:09 eric-burel

This needs a change in Vulcan Meteor too, because the structure of the response is defined there.

eric-burel avatar Sep 30 '20 07:09 eric-burel