Skip to main content

Very annoying that the @include directives were removed from API 2024-10 and later. when used like:


    query ($updateId: ID!, $includeBody: Boolean!) {
updates(ids: [$updateId]) {
id
body @include(if: $includeBody)
assets {
id
name
url
file_size
}
}
}

There were no notes on this. Its not in the change logs


It was easy enough to work around, but annoying to need two queries or write code to build the query string when we used to just be able to set a variable to include it or not.

Hey @anon29275264,


The team is looking into this! I’ll update this thread when we have more info.


Best,

Rachel


I should clarify that other queries with @include work - where its got something after it (so another object), but fails when you’re trying to include (or not) primitive values (like strings or numbers). I haven’t fully tested everything out either (nor the exact query below - just don’t want to go find another example).


    query ($updateId: ID!, $includeAssets: Boolean!) {
updates(ids: ($updateId]) {
id
body
assets @include(if $includeAssets) {
id
name
url
file_size
}
}
}

Reply