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.

GraphQLError: Names must only contain [_a-zA-Z0-9] but "application/pdf" does not

See original GitHub issue

Hey 😊 I encountered this error:

GraphQLError: Names must only contain [_a-zA-Z0-9] but "application/pdf" does not.
      at assertName (/platformatic/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/type/assertName.js:31:13)
      at assertEnumValueName (/platformatic/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/type/assertName.js:58:10)
      at /platformatic/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/type/definition.js:1223:49
      at Array.map (<anonymous>)
      at defineEnumValues (/platformatic/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/type/definition.js:1213:35)
      at new GraphQLEnumType (/platformatic/node_modules/.pnpm/graphql@16.6.0/node_modules/graphql/type/definition.js:1080:20)
      at constructGraph (/platformatic/packages/sql-graphql/lib/entity-to-type.js:58:21)
      at mapperToGraphql (/platformatic/packages/sql-graphql/index.js:43:20)
      at Plugin.exec (/platformatic/node_modules/.pnpm/avvio@8.2.0/node_modules/avvio/plugin.js:130:19)
      at Boot.loadPlugin (/platformatic/node_modules/.pnpm/avvio@8.2.0/node_modules/avvio/plugin.js:272:10) {
    path: undefined,
    locations: undefined,
    extensions: [Object: null prototype] {}

To add a little more context, the table where it failed contained a column defined like that:

`document` enum('application/pdf','image/jpeg','image/png') DEFAULT NULL,

Can we support this column type? In the meanwhile, I’ll add a PR to enhance the logging info on platformatic side when we encounter this.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mcollinacommented, Dec 18, 2022

I think this might be the same of https://github.com/platformatic/platformatic/pull/403.

1reaction
mcollinacommented, Dec 18, 2022

Would you like to send a PR to fix this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "" does not.
After upgrading from 3.0.0-beta.14 to 3.1.4 i'm getting this error. Missing onError handler for invocation 'extracting-queries', error was 'Error: Names ...
Read more >
GraphQL is returning "Names must match" error when the Key ...
GraphQL only allows keys starting with ASCII character or an underscore. You can use resolve functions to map old names to new.
Read more >
Error handling - Apollo GraphQL Docs
A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ. OPERATION_RESOLUTION_FAILURE. The...
Read more >
GraphQL specification
If a Document contains only one operation, that operation may be unnamed or represented in the shorthand form, which omits both the query...
Read more >
GraphQL error handling to the max with Typescript, codegen ...
In the codegen configuration, we have defined mappers between the GraphQL schema types and the Typescript types. But this is not used at...
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