Craft v3.5.7

First off, graphql is not being used on this site so I'm not sure why the schemas are being generated and causing errors. The graphql.yml file contents:

  enabled: false
  expiryDate: null

There are graphql schemas that get generated (I assume during a project-config/apply?) and during a deploy, the project-config/apply is failing due to an error:

Applying changes from your project config files ... error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Public Schema' for key 'gqlschemas_name_unq_idx'
The SQL being executed was: INSERT INTO `gqlschemas` (`uid`, `name`, `isPublic`, `scope`, `dateCreated`, `dateUpdated`) VALUES ('c8b6ee58-XXXXXX', 'Public Schema', 1, '[]', '2021-10-06 17:28:52', '2021-10-06 17:28:52')

I was able to delete the schema file locally and delete that record from the db and get project-config to apply w/o errors but after committing/merging to staging, the schema files are regenerated and it still throws this error (even after deleting the record from the db manually).

enter image description here

1 Answer 1


GraphQL is enabled by default in Craft CMS. Have you tried adding 'enableGql' => false to your general.php config file? This should disable anything related to GQL, including the schemas. Then go to the Utilities -> Project Config and rebuild your config.

Ref: https://craftcms.com/docs/3.x/config/config-settings.html#enablegql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.