Coder Social home page Coder Social logo

godotgraphql's Introduction

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

godotgraphql's People

Contributors

dracks avatar jsinglamms avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.