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

Error: Cannot convert object to primitive value in GHA #2016

Closed
ertrzyiks opened this issue Sep 28, 2021 · 3 comments · Fixed by #2017 or #2030
Closed

Error: Cannot convert object to primitive value in GHA #2016

ertrzyiks opened this issue Sep 28, 2021 · 3 comments · Fixed by #2017 or #2030
Labels
📦 released This issue or pull request is released

Comments

@ertrzyiks
Copy link
Contributor

ertrzyiks commented Sep 28, 2021

Describe the bug

When I run github action on my schema it crashes with
Screenshot 2021-09-28 at 16 50 25

Is #1959 available to the github action?

To Reproduce

Have a type with default input value like
https://github.com/ertrzyiks/graphql-inspector-issue-2016

Run kamilkisiela/graphql-inspector github action on such schema
https://github.com/ertrzyiks/graphql-inspector-issue-2016/pull/1/checks?check_run_id=3736230467

Expected behavior

No runtime errors

@ertrzyiks ertrzyiks changed the title Error: Cannot convert object to primitive value Error: Cannot convert object to primitive value in GHA Sep 28, 2021
@kamilkisiela kamilkisiela added the ⏳ waiting for release This issue or pull request is waiting to be released label Sep 29, 2021
@kamilkisiela
Copy link
Owner

Released in v3.0.1

@kamilkisiela kamilkisiela added 📦 released This issue or pull request is released and removed ⏳ waiting for release This issue or pull request is waiting to be released labels Sep 29, 2021
@ertrzyiks
Copy link
Contributor Author

@kamilkisiela thank you for the fast reaction ⚡

@ertrzyiks
Copy link
Contributor Author

ertrzyiks commented Oct 7, 2021

It still happens to my schema, because I have an array of object as a default value and this array is matched with this condition
https://github.com/kamilkisiela/graphql-inspector/blob/master/packages/core/src/utils/string.ts#L82

export function safeString(obj: any) {
  if (obj != null && typeof obj.toString === 'function') {
    return `${obj}`; <-- here we do unsafe stringification on the array
  }
  return inspect(obj);
}

We do array.toString() but array objects suffer from the same error.

Screenshot 2021-10-07 at 08 27 56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 released This issue or pull request is released
Projects
None yet
2 participants