Answers.Body: <p>GraphQL is enabled by default in Craft CMS. Have you tried adding
  <code>'enableGql' =&gt; false</code>
  to your <code>general.php</code> config file? This should disable anything related to GQL, including the schemas. Then go to the Utilities -&gt; Project Config and rebuild your config.</p>
  <p>Ref: <a href="https://craftcms.com/docs/3.x/config/config-settings.html#enablegql" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/config/config-settings.html#enablegql</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-07T21:17:36.300Z
Answers.LastActivityDate: 2021-10-07T21:17:36.300Z
Answers.UserDisplayName: Dalton Rooney
Body: <p>Craft v3.5.7</p>
  <p>First off, <strong>graphql is not being used on this site</strong> so I'm not sure why the schemas are being generated and causing errors. The graphql.yml file contents:</p>
  <pre><code>publicToken:
    enabled: false
    expiryDate: null
  </code></pre>
  <p>There are graphql schemas that get generated (I assume during a <code>project-config/apply</code>?) and during a deploy, the <code>project-config/apply</code> is failing due to an error:</p>
  <pre><code>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')
  </code></pre>
  <p>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).</p>
  <p><a href="https://i.sstatic.net/alrml.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/alrml.png" alt="enter image description here" /></a></p>
  
Tags: <graphql><projectconfig>
Title: Graphql schema causing error on project-config/apply
ThreadText: # Graphql schema causing error on project-config/apply
  
  (Asked by: username_0 on 2021-10-06)
  
  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:
  
  ```
  publicToken:
    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](https://i.sstatic.net/alrml.png)](https://i.sstatic.net/alrml.png)
  
  **Tags:** graphql, projectconfig
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-10-07. Score: 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>
  
  
  ---
  
  