Payload content delivery system - GraphQL Error: Names must consist solely of [_a-zA-Z0-9] characters, however, "_9:00" does not meet this criteria

I've encountered a problem with Payload CMS where a GraphQL error related to enum value naming is causing issues. The problem arises with a collection named FormSubmission that includes a field called appointmentTime, which utilizes a select field type with predetermined options. Let's take a look at the relevant code snippet:

import { CollectionConfig } from "payload/types";

const FormSubmission: CollectionConfig = {
  slug: "form-submissions",
  fields: [
    {
      type: "select",
      name: "appointmentTime",
      label: "Appointment Time",
      required: true,
      options: [
        { label: "09:00 AM", value: "09:00" },
        { label: "10:00 AM", value: "10:00" },
        { label: "11:00 AM", value: "11:00" },
        { label: "12:00 PM", value: "12:00" },
        { label: "01:00 PM", value: "13:00" },
        { label: "02:00 PM", value: "14:00" },
        { label: "03:00 PM", value: "15:00" },
        { label: "04:00 PM", value: "16:00" },
        { label: "05:00 PM", value: "17:00" },
      ],
    },
  ],
};

export default FormSubmission;

Upon running the application with yarn run dev, the following error is displayed:

unhandledRejection GraphQLError: Names must only contain [_a-zA-Z0-9] but "_9:00" does not. 

The code was functioning correctly previously, and no changes have been made. The latest versions of both Payload CMS and its dependencies are being utilized. It's unclear what could be causing this issue, considering the enum values in the code seem valid. Any insights or suggestions on resolving this error would be greatly appreciated.

I have attempted to resolve the issue by deleting the file and starting over, restarting the dev server, and isolating the code with /*

Answer №1

Your opinion's value cannot include the character ":".

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the process for switching directories and renaming a file when uploading in nodeJs?

I am currently using multer and fs to handle the upload of an image file. How can I modify the directory where uploaded files are stored? Currently, all files are saved in my "routes" folder instead of the "uploads" folder created by multer. Additionally, ...

I encountered a "TypeError: Unable to access property 'name' of undefined" error when attempting to export a redux reducer

UPDATE: I encountered an issue where the namePlaceholder constant was returning undefined even though I was dispatching actions correctly. When attempting to export my selector function, I received an error: https://i.sstatic.net/MwfUP.png Here is the c ...

Limit the Jquery selection specifically to elements on the modal page

Recently I encountered an issue with a webpage that opens a modal form. The problem arises when the validation function, written in JQuery, checks all fields on both the modal and the page beneath it. //validate function function validateFields() { v ...

Is it possible to create a return using messageEmbed in Discord?

I have been working on creating a Discord bot that responds to the ! status command with the server status. I took inspiration from this existing bot. The only change I made was to ensure that the bot replies immediately to the ! status command without re ...

The Challenge of the Universe's Origin

While watching the latest episode of The Big Bang Theory (Season 11, Episode 20), I found myself intrigued by Dr. Wolcott's unusual encryption method. In a quirky twist, this nutty theoretical cosmologist wrote his notes backward and converted all let ...

Working with node.js to set up an ordering function

I am working with node.js and express3. To use mongodb, I decided to install the mongo-lazy package. This is the simple GET router I have set up: var db = require('mongo-lazy').open({ db: 'somedb', host: '127.0.0.1' ...

How can I authenticate to enable access to static files in Next.js?

After exploring various authentication options for Next.js that wouldn't require server-side changes, I aimed to prevent users from accessing the website without entering a password. I conducted tests with NextAuth and managed to block pages using se ...

Tips for inserting a row component into a table using Angular 7

I am currently using the latest version of Angular (7.2.0). I have created a custom tr component as follows: import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-table-row', templateUrl: './table- ...

Error encountered while attempting to save a Mongoose post on Heroku, although it is successful

My aim is to post to my MongoDB Atlas database using node, express, mongoose, and Heroku. While a Postman POST request with Raw JSON body: { "title": "heroku post", "description": "post me plsssss" } works f ...

`Angular2 - exploring the complexities of function scope`

I'm facing a challenge while working on my Angular2 Sample with the http module. Here is a snippet from my component: app.loginComponent = ng.core.Component({ selector: 'login', templateUrl: 'app/login/login.html&ap ...

Designing a pop-up window for fetching data using AngularJS

I'm having trouble loading data into a modal window using AngularJS. I want the URL to change when a link is clicked and have the data load into a modal window instead of a new page. I attempted to use the jQuery Facebox plugin, but it doesn't s ...

How can JavaScript be used to dynamically load a second advertisement image immediately after the first ad image is successfully loaded?

Currently, I am working on ensuring that the 2nd ad image loads ONLY AFTER the 1st ad image has been loaded (please refer to the image with blue boxes). This is crucial as I have a CSS animation transitioning smoothly from the 1st ad image to the 2nd ad im ...

Receiving a NoSessionIdError issue when using Webdriver.io

Currently, I am in the process of setting up and configuring webdriver.io and Jasmine. As per the guidelines provided, my script is located at test/specs/first/test2.js (as per the configuration) and includes the following: var webdriverio = require(&apo ...

Adjust the height of each card dynamically based on the tallest card in the row

I am working on a row that looks like this: <div class="row"> <div class="col"> <div class="card"> <div class="card-body"> <h3 class="card-title ...

What is the best way to adjust the width of a textarea based on its content

How can I dynamically set the width of a React Semantic UI textarea based on its content? Setting min-width doesn't seem to be working. Any suggestions? <Textarea key={idx} defaultValue={formattedText} className="customInpu ...

Steps for interacting with a button of the <input> tag in Selenium using Python

As I attempt to complete a form submission, I encounter an issue where clicking the submit button does not produce any action. It seems that the problem lies with the button being tagged as <input>: <input type="submit" name="submit ...

Concealing the NavBar When Showing a Popup Using React

I am facing a challenge with hiding my bootstrap navbar that has a CSS property of position: sticky-top when I display a pop-up slideshow. I am working with React. I have attempted to target the navbar element in my click handler and adjust the display pro ...

Is it possible to modify the font color of a specific MenuItem in material-ui?

I've scoured every corner of the internet, but I'm still stumped by this question: How can I tweak the text color (not the background) for a selected or hovered MenuItem? I know the solution lies within useStyles, but my attempts thus far have be ...

Encountering a message error for the Collapse component in Material UI

I'm currently working on creating a hamburger menu using Material UI List in Next.js, inspired by the Nested List example in the Material UI documentation. However, I've encountered an error when using "collapse" in my code. The rest of the code ...

Obtaining the source code from a different domain website with the help of jQuery

Is there a way to extract part of the source code from a YouTube page without using server-side programming? I've tried cross-domain AJAX techniques like Yahoo YQL and JsonP. While Yahoo YQL allows me to grab part of the source code, I'm facing ...