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] "with" query parameter #5

Open
Zignature opened this issue Sep 14, 2024 · 1 comment
Open

[GRAPHQL] "with" query parameter #5

Zignature opened this issue Sep 14, 2024 · 1 comment

Comments

@Zignature
Copy link

Zignature commented Sep 14, 2024

How do I use the with parameter in a query? And what is it for?
I'm guessing it's a filtering parameter...

query myQuery {
  exp_channel_entries(
    channel: "my_channel",
    with: ???
  ) {
    data {
      ...
    }
  }
}

I'm running coilpack 1.x-dev

@bryannielsen
Copy link
Contributor

@Zignature sorry this isn't in the official docs, a lot of the GraphQL API is meant to be self-documenting through tools like GraphiQL but we should get this in the docs as well.

The with parameter takes A pipe separated list of relationships to eager load. So this is just a parameter to help with performance. If you had the following query then including the with will reduce the number of database queries required to load the Author attributes

exp_channel_entries(with: "author") {
    data {
      author {
        screen_name
      }
    }
  }

@bryannielsen bryannielsen transferred this issue from ExpressionEngine/Coilpack Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants