Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement gql client (re) #99

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public GetUnsignedTransactionHex(
_blockChain = blockChain;
_swarm = swarm;

#if DEBUG
Signing(UnsignedTransactionHex);
#endif
// #if DEBUG
// Signing(UnsignedTransactionHex);
// #endif
}

public string UnsignedTransactionHex { get; private set; }
Expand Down
26 changes: 0 additions & 26 deletions frontend/Saver-22b-godot/Config.cs

This file was deleted.

34 changes: 0 additions & 34 deletions frontend/Saver-22b-godot/gql/GraphQLClient.cs

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/Saver-22b-godot/gql/Queries.cs

This file was deleted.

10 changes: 10 additions & 0 deletions frontend/Saver-22b-godot/gql/query.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var get_villages_query = "query {
villages {
id
name
width
height
worldX
worldY
}
}"
5 changes: 5 additions & 0 deletions frontend/Saver-22b-godot/gql/svr_gql_client.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends GQLClient

func _ready():
print("client ready")
set_endpoint(false, "localhost", 38080, "/graphql")
9 changes: 7 additions & 2 deletions frontend/Saver-22b-godot/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ config/icon="res://icon.svg"
[autoload]

GlobalSigner="*res://scripts/sign/Signer.gd"
GraphQlClient="*res://gql/GraphQLClient.cs"
Config="*res://Config.cs"
SvrGqlClient="*res://gql/svr_gql_client.gd"

[display]

Expand All @@ -32,6 +31,12 @@ window/stretch/mode="canvas_items"

project/assembly_name="Saver-22b-godot"

[file_customization]

folder_colors={
"res://scenes/": "yellow"
}

[rendering]

renderer/rendering_method="gl_compatibility"
Expand Down
21 changes: 21 additions & 0 deletions frontend/Saver-22b-godot/scenes/install_kitchen_equipment.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[gd_scene format=3 uid="uid://c7g8if1jb33im"]

[node name="InstallKitchenEquipment" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Background" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -1.0
offset_right = -1120.0
offset_bottom = -581.0
grow_horizontal = 2
grow_vertical = 2
color = Color(1, 0.623529, 0, 1)
6 changes: 5 additions & 1 deletion frontend/Saver-22b-godot/scenes/intro.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://cg773cnsx4rb0"]
[gd_scene load_steps=3 format=3 uid="uid://cg773cnsx4rb0"]

[ext_resource type="Script" path="res://scripts/intro.gd" id="1_0m54y"]
[ext_resource type="Script" path="res://scripts/gql_test.gd" id="2_yxm3e"]

[node name="Intro" type="Control"]
layout_mode = 3
Expand Down Expand Up @@ -96,5 +97,8 @@ grow_vertical = 2
theme_override_font_sizes/font_size = 70
text = "Play"

[node name="gql_test" type="Node" parent="."]
script = ExtResource("2_yxm3e")

[connection signal="button_down" from="QuitButtonContainer/Button" to="." method="_on_quit_button_button_down"]
[connection signal="button_down" from="PlayButtonContainer/Button" to="." method="_on_play_button_button_down"]
27 changes: 27 additions & 0 deletions frontend/Saver-22b-godot/scripts/gql_test.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
extends Node

var queryExecutor: GQLQueryExecuter

# Called when the node enters the scene tree for the first time.
func _ready():
var query = GQLQuery.new("villages").set_props([
"id",
"name",
"width",
"height",
"worldX",
"worldY",
])

queryExecutor = SvrGqlClient.query('query', {}, query)
queryExecutor.graphql_response.connect(self.graphql_response)
add_child(queryExecutor)

queryExecutor.run({})

func graphql_response(data: Dictionary):
print(data)

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
Loading