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

GraphQL Depreciation Warning #5068

Open
mortscode opened this issue Oct 9, 2019 · 1 comment

Comments

@mortscode
Copy link

commented Oct 9, 2019

Description

Setting up Craft 3.3.7 as a headless CMS for a Gatsby site.

Using a query similar to the query on the Craft 3 Documentation: https://docs.craftcms.com/v3/graphql.html#an-example-query-and-response

When I enter the following into the GraphQL > Explore tab in the CP, I get a depreciation warning saying that I need to query with an all() function.

{
  entries (section: "promotions"){
    id
    title
    ... on promotions_promotions_Entry {
      promoHeroImage {
        filename
      }
      promoDescription
    }
  }
}

The error:

Looping through element queries directly has been deprecated. Use the all() function to fetch the query results before looping over them.

Origin:

/var/www/html/vendor/webonyx/graphql-php/src/Executor/Executor.php:1196

Stack Trace:
stack-trace.txt

Steps to reproduce

  1. Fire up Craft 3.3.7 with the GraphQL Endpoint turned on
  2. Query over a Channel of entries
  3. Look for Depreciation Warning

Additional info

  • Craft version: 3.3.7
  • PHP version: 7.2
  • Database driver & version: MySQL 5.5.5 MariaDB-10.3.17
  • Plugins & versions: Redactor (latest)
@andris-sevcenko andris-sevcenko self-assigned this Oct 9, 2019
@andris-sevcenko

This comment has been minimized.

Copy link
Member

commented Oct 9, 2019

I can't reproduce this locally at all. Any chance that was from a different query or does that happen every time you try to run that query?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.