wayfair-incubator / node-froid

Project generated via @wayfair-incubator oss-template
MIT License
15 stars 1 forks source link

Improves error messages when an empty key is generated #30

Closed gwardwell closed 2 months ago

gwardwell commented 2 months ago

Description

In cases where FROID schema schema generation results in empty @key fields (such as when only __typename is used as a key), FROID would return an unhelpful message:

Syntax Error: Expected Name, found "}".

This PR catches that error and instead throws an improved error to better explain what's going on:

Failed to parse key fields "" for type "SomeType" due to error: Syntax Error: Expected Name, found "}". 

Type of Change

Checklist