Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: GraphQL Autocomplete and Explorer not working #16316

Closed
brookepaxman opened this issue Dec 11, 2024 · 4 comments
Closed

[5.x]: GraphQL Autocomplete and Explorer not working #16316

brookepaxman opened this issue Dec 11, 2024 · 4 comments
Labels

Comments

@brookepaxman
Copy link

What happened?

Description

We recently upgraded from Craft 4 to Craft 5 and we noticed that the GraphQL Autocomplete and Explorer stopped working as if the introspection queries stopped working. This error is in the browser console: "Error: Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: undefined."

This happens with all of our environments - local with DDEV and staging.

Steps to reproduce

  1. Login to the Control Panel
  2. Navigate to GraphQL > GraphiQL
  3. Click Explorer
  4. See "No Schema Available"

Expected behavior

The explorer shows the GraphQL schema and pressing CTRL + Space suggests GraphQL symbols.

Actual behavior

No schema or autocomplete available.

Craft CMS version

Craft Pro 5.5.3

PHP version

8.2.26

Operating system and version

Linux 5.15.0-1058-aws

Database type and version

MySQL 8.0.40

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.10-23)

Installed plugins and versions

  • Amazon S3 | 2.2.1
  • Amazon SES | 3.1.0
  • Blitz | 5.9.6
  • FeedMe | 6.5.0
  • Freeform | 5.7.3
  • Guest Entries | 4.0.1
  • ImageOptimize | 5.0.3
  • Neo | 5.2.17
  • oEmbed | 3.1.1
  • Redactor | 4.2.0
  • Redactor Custom Styles | 5.0.0
  • Retcon | 3.2.1
  • Retour | 5.0.3
  • Reverse Relations | 3.0.0
  • SEOmatic | 5.1.7
  • Sprig | 3.5.1
@brandonkelly
Copy link
Member

I’m not able to reproduce that.

It may be the result of a plugin, such as a field type that’s not registering its GraphQL type properly. A quick way to test that is to enable safeMode, clear your data caches (php craft clear-caches/data), and then refresh the page.

If introspection starts working again, then disable safeMode and disable your plugins + clear caches one-by-one until you identify which plugin was causing the issue.

If it’s still a problem, please send a database backup and your Composer files into [email protected] and we can look into it further from there.

@LinneaHarts
Copy link

I am also seeing this, with Craft 5.5.5

@brandonkelly
Copy link
Member

We were able to reproduce with a customer’s database. It ended up being the same issue as #15068. GraphQL schemas can be much larger in Craft 5 as a result of Matrix entrification (Matrix block types are now entry types; sub-fields are now global), which can lead to a significant increase in custom field arguments within entry queries throughout the GraphQL API.

I managed to prune out some unnecessary custom field arguments for Craft 5.6, which in my example site brought the introspection schema down from 74MB to 47MB.

@brandonkelly
Copy link
Member

Craft 5.6.0 is out with those changes 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants