How to clear GraphQL cache on a local DDEV Craft CMS

To clear the GraphQL cache run the following two commands: ddev craft clear-caches/all & ddev craft cache/flush-schema.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 09/17/2022 at 12:18
Last Updated on 09/17/2022 at 12:47
Three flowers that represent GraphQL, CraftCMS & DDEV side by side, with the text "Clear GraphQL Cache" beneath them.

To clear the GraphQL cache run the following two commands: ddev craft clear-caches/all & ddev craft cache/flush-schema.

A screenshot of a GraphQL error that could occur if the GraphQL cache has not been flushed.

The error that you encountered could look similar to the one above.

In order to clear the GraphQL cache a Craft CMS hosted locally using DDEV, you must run the following two commands in Terminal, with the current directory set to that where your Craft CMS DDEV instance is found. Incase you are looking to fix this on a hosted instance, please consult the tutorial linked below.

How to clear GraphQL cache on a hosted Craft CMS

Step One: Clear all caches

A screenshot of Terminal showing the clear Craft CMS cache command on DDEV.

In Terminal, with the current directory set to the DDEV Craft CMS, run the following line:

ddev craft clear-caches/all

Step Two: Flush Schema

A screenshot of Terminal showing the Craft CMS Flush Schema command on DDEV.

In Terminal, with the current directory set to the DDEV Craft CMS, run the following line:

ddev craft cache/flush-schema

Any Questions ?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.

SubscribeInquireView All PostsView All ServicesView All Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe