Underscore in field name causes GraphQL error: Unable to find Mongo field which maps to graphQL path error
See original GitHub issueBug report
Describe the bug
I’m migrating from Keystone 4 to Keystone 5. I have a database that has fields which have underscores in them (news_site, news_site_long). When I define these fields in createList
I get the following error:
GraphQL error: Unable to find Mongo field which maps to graphQL path news
I’ve been searching in the docs to prevent this behavior, but I couldn’t find an option.
To Reproduce
Steps to reproduce the behaviour. Please provide code snippets or a repository:
- Define a field with an underscore in it
- In the admin GUI, Click on the list
- See error
Expected behaviour
I expect to see a list of all my entries in that MongoDB collection.
Screenshots
System information
- OS: Debian, MacOS
- Browser (if applies): Opera, Chrome
Additional context
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:20 (5 by maintainers)
Top Results From Across the Web
How to resolve mongodb embedded document array of object ...
My Graphql query is working now as below. query{ feeds { id feedname feedtime feeditems { farmintakes { id name remarks } id...
Read more >GraphQL Types, Resolvers, and Operators - MongoDB
If the field name is not defined for the document at all, or if the value is explicitly set to null , then...
Read more >How To Set Up a Ruby on Rails GraphQL API - DigitalOcean
In this tutorial, you will build a GraphQL-powered Ruby on Rails ... by appending an underscore ( _ ) followed by the environment...
Read more >typescript-operations - GraphQL Code Generator
Without loading your GraphQL operations ( query , mutation , subscription and fragment ), you won't see any change in the generated output....
Read more >Prisma schema API (Reference)
Name, Required, Type, Description. provider, Yes, String ( postgresql , mysql , sqlite , sqlserver , mongodb , cockroachdb ), Describes which data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By accident, I found a possible solution/workaround: Define a non-underscore item as first item in the list (title, name, etc.). All underscore items will now behave correctly.
That worked partially for me, as
defaultSort:
breaks it again.