GraphQL client

An asset by jsingla
The page banner background of a mountain and forest
GraphQL client hero image

Quick Information

0 ratings
GraphQL client icon image
jsingla
GraphQL client

A small library to do graphql request from gdscript without external dependencies

Supported Engine Version
4.0
Version String
0.1
License Version
MIT
Support Level
community
Modified Date
4 months ago
Git URL
Issue URL

Godot GraphQLClient Addon

Instalation

  1. download the contents (or clone) and put inside $PROJECT/addons
  2. Create a class extending GQLClient
  3. Implement in a _ready function or in the same _init to configure it calling to set_endpoint(is_secure, host, port, path)
  4. Add this class as an autoload of your godot project.

Usage

This library uses his own objects to create the query. But provide also a raw argument to call with a string.

  1. create some graphql query:
var query =GQLQuery.new("someProp").set_args({"variable":"arg"}).set_props([
    "otherProp",
    GQLQuery.new("moreComplexProp")
])
  1. Call to your singleton to the query method and add it to your node_tree:
var my_query_executer = ServerConfigInstance.query("NameOfTheQuery", {"SomeVariables":"HisType"}, query)
  1. Connect to graphql_response signal to retrieve the data
  2. Execute the run method with the variables as args
my_query_executor.run({"SomeVariables":42})

Features

  • Tested with a django-graphene server
  • Do queries and mutations
  • gql_query tested using gut

Documentation

GQLQuery samples

The sample of use in the usage will generate something like this:

someProp(arg:$variable){
    otherProp
    moreComplexProp
}

As you can see there is no query information or mutation. The query or mutation is added when you call to client.query or client.mutation. The query generated in the point usage 4 is the following:

query NameOfTheQuery(SomeVariable: HisType){
    someProp(arg:$variable){
        otherProp
        moreComplexProp
    }
}

Adding the variable of SomeVariable to 42

A small library to do graphql request from gdscript without external dependencies

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
GraphQL client icon image
jsingla
GraphQL client

A small library to do graphql request from gdscript without external dependencies

Supported Engine Version
4.0
Version String
0.1
License Version
MIT
Support Level
community
Modified Date
4 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers