Method: Appwrite::Graphql#query

Defined in:
lib/appwrite/services/graphql.rb

#query(query:) ⇒ Any

Execute a GraphQL mutation.

Parameters:

  • query (Hash)

    The query or queries to execute.

Returns:

  • (Any)


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/appwrite/services/graphql.rb', line 15

def query(query:)
    path = '/graphql'

    if query.nil?
      raise Appwrite::Exception.new('Missing required parameter: "query"')
    end

    params = {
        query: query,
    }
    
    headers = {
        "x-sdk-graphql": 'true',
        "content-type": 'application/json',
    }

    @client.call(
        method: 'POST',
        path: path,
        headers: headers,
        params: params,
    )
end