Thanks for the great GraphQL module. I successfully queried the data without issue.
curl http://localhost/graphql -d '{"query": "query page1 { page(id:1) { title } }" }'

However, how can I use a persisted query?
I tried with the following
curl http://localhost/graphql -d '{"queryId": "page1" }'
but it returns {"errors":[{"message":"PersistedQueryNotFound"}]}

Do you have any documentation around? Thanks!

CommentFileSizeAuthor
#3 Persisted-queries-UI.jpg132.52 KBbisonbleu

Comments

richard cheung created an issue. See original summary.

richard cheung’s picture

Issue summary: View changes
bisonbleu’s picture

StatusFileSize
new132.52 KB

I'm also wondering about this… I'm not sure what to make of the UI…?

persisted queries UI

bisonbleu’s picture

Title: Persisted query » Persisted query not working in 4.x ?
richard cheung’s picture

Refer to https://github.com/apollographql/apollo-link-persisted-queries and
After enabling the Automatic Persisted Query, I can map the query with a hash and run the query with queryId.

curl http://localhost/graphql -d '{
    "query": "query page1 { page(id: 1)  { title } }",
    "extensions": {
        "persistedQuery": {
            "version": 1,
            "sha256Hash": "__HASH_KEY_HERE__"
        }
    }
}'

curl http://localhost/graphql -d '{ "queryId": "__HASH_KEY_HERE__" }'

However, there is no way to browse the persisted queries in the UI.
Not under the Persisted queries tab nor the Explorer tab.

usmanjutt84’s picture

+1 - I also need to learn how we can generate and setup persisted query in the Drupal UI.

kingdutch’s picture

Status: Active » Closed (works as designed)

The persisted query UI allows configuring the order of persisted query plugins and enabling/disabling the functionality. It's not intended as an overview to see or manage persisted GraphQL queries.

The only currently supported plugins for persisted queries is the Automatic Persisted Queries (APQ) plugin that's compatible with Apollo.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.