For complex default values, the string being passed to JSON.parse might look like '{foo: "bar"}', which is a lax/incorrect JSON representation. Keys require "double quotes".
The json5 package seemed to be the best solution for handling this fact/situation. I don't love adding another dependency, but I don't think that (re-)implementing it here is a great idea. It also gets over 57mm downloads a week, so it seems solid.
For complex default values, the string being passed to
JSON.parse
might look like'{foo: "bar"}'
, which is a lax/incorrect JSON representation. Keys require"double quotes"
.The
json5
package seemed to be the best solution for handling this fact/situation. I don't love adding another dependency, but I don't think that (re-)implementing it here is a great idea. It also gets over 57mm downloads a week, so it seems solid.Fixes https://github.com/charlypoly/graphql-to-json-schema/issues/67