question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve error message when missing `queryGenerationFactories` in the template.

See original GitHub issue

Thank you for this great generator.

While Build Template it throws this error:

 Error: Cannot generate a random value for scalar 'smallint'.
  The random generator is not able to randomly generate a value for non-standard GraphQL scalars.
  You have to provide a custom factory by providing this in your config:
  {
  'smallint': () => generateRandomCustomScalar()
  }

Can you please provide an example on how to fix this? Documentation is not clear enough, where the 'smallint': () => generateRandomCustomScalar() should go in the config? Can you provide an example of generateRandomCustomScalar()?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
efstathiosntonascommented, Jun 7, 2022

You’re welcome @pelletier197, and again, thanks for this great generator. If you need anything please tag me! If you want to get exactly the same experience like mine then visit Hasura Getting Started.

1reaction
efstathiosntonascommented, Jun 7, 2022

great, these are some common Hasura scalars:

    {
        _text: "loremipsum",
        bigint: 1000,
        date: "2022-03-06T08:23:45.000Z",
        float8: 0.1,
        geography: { type: "Point", coordinates: [0, 0] },
        geometry: { type: "Point", coordinates: [0, 0] },
        jsonb: {},
        numeric: 1,
        smallint: 42,
        timestamp: "2022-03-06T08:23:45.000Z",
        timestamptz: "2022-03-06T08:23:45.000Z",
        uuid: "a12ce80c-42e3-4149-89cc-4afda30e5e7f",
      }

After adding all these scalars above it throws a new error:

  Error: Fatal error: A recursive input with a non-nullable circular reference was detected, which makes it impossible to generate a query. If you ever see this error, it means that your GraphQL uses an invalid schema.
  at generateInput (file:///private/var/folders/yz/dk5dbx8n2hqcfk1kdktxmknh0000gn/T/carbon-multi-page@2.0.0/node_modules/.pnpm/@magidoc+plugin-query-generator@2.0.0/node_modules/@magidoc/plugin-query-generator/build/generator/fakeGenerator.js:34:23)

ps. I’m using Hasura 2.7.0

I’ll try to debug it

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Make Django Raise an Error for Missing Template ...
Templates render this for missing variables, and it defaults to the empty string. The docs have more detail on how this works.
Read more >
Confusing error message on missing template value #1579
I re-created your chart and installing with a blank image tag I get the Image Tag Required message. If i install with a...
Read more >
How to Report Errors in Forms: 10 Design Guidelines
Error messages are an indicator of system status: they let users know that a hurdle was encountered and give solutions to fix them....
Read more >
6 Form Error Message Mistakes Almost Everyone Makes
Discover the most common mistakes when it comes to creating error messages for your web forms and learn how to correct those errors...
Read more >
Resolve template validation or template format errors in ... - AWS
I receive an error message when I try to create my AWS ... type for the template to use if no value is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found