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

Add Partial Success (Data & Error) to graphql response #210

Open
PageTMcEneaney opened this issue May 31, 2023 · 2 comments
Open

Add Partial Success (Data & Error) to graphql response #210

PageTMcEneaney opened this issue May 31, 2023 · 2 comments

Comments

@PageTMcEneaney
Copy link

PageTMcEneaney commented May 31, 2023

Similar to #100 we'd like to add an enhancement to Parrot responses.

At the moment, there is no option to add both data and error objects outside of the body. We'd like to add to support partial success graphql responses. See example. I want to make sure this is compatible with the parrot-friendly formatting of the scenarios so I think we should update the scenarios file to use or add a second example app

{
  "data": {
    "getInt": 12,
    "getString": null
  },
  "errors": [
    {
      "message": "Failed to get string!"
      // ...additional fields...
    }
  ]
}

Here is my WIP forked repo & branch

Note: to test this locally I needed to link parrot-friendly to the local version with “parrot-friendly”: “file:../../packages/parrot-friendly”,, if the parrot-friendly changes need to be approved & merged first I can remove the friendly-pirate-app changes and include those in a separate followup PR

@github-actions
Copy link

Thanks for opening your first issue. Pull requests are always welcome!

@PageTMcEneaney
Copy link
Author

The main changes are in packages/parrot-friendly/src/Mock.js & the test file. The other changes are adding a second example app friendly-pirate-app which is optional but seemed cleaner than overwriting the original scenario syntax

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

No branches or pull requests

1 participant