https://github.com/mfix22/graphql-error-parser
Create field summary from GraphQL error response
https://github.com/mfix22/graphql-error-parser
Last synced: 2 months ago
JSON representation
Create field summary from GraphQL error response
- Host: GitHub
- URL: https://github.com/mfix22/graphql-error-parser
- Owner: mfix22
- Created: 2017-09-13T06:41:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T23:30:47.000Z (over 2 years ago)
- Last Synced: 2025-02-10T03:14:20.461Z (4 months ago)
- Language: JavaScript
- Size: 182 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `graphql-error-parser`
```javascript
const parse = require('graphql-error-parser')
const err = 'Variable "$input" got invalid value {"id":"3","address":{"zip":"1","state":"MN","streetAddress1":"Test"}}.\nIn field "address": In field "city": Expected "String!", found null.\nIn field "address": In field "zip": Expected type "ZipCode", found "1": 00001 is not a valid zipcode'parse(err)
/*
{
address: {
city: {
type: 'String!',
message: ''
},
zip: {
type: 'ZipCode',
message: '00001 is not a valid zipcode'
}
}
}
*/
```