From 91982dd56b4f5f581d1b9fb19c5efdd3f1211d25 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Tue, 1 Oct 2024 15:27:22 +0530 Subject: [PATCH 01/15] [Automated] Update the native jar versions --- .../Ballerina.toml | 10 + .../Dependencies.toml | 405 +++++++++++++++++ .../graphql-client-test-suite/Ballerina.toml | 10 + .../Dependencies.toml | 413 +++++++++++++++++ .../Ballerina.toml | 10 + .../Dependencies.toml | 422 +++++++++++++++++ .../Ballerina.toml | 10 + .../Dependencies.toml | 426 +++++++++++++++++ .../Ballerina.toml | 10 + .../Dependencies.toml | 418 +++++++++++++++++ .../graphql-service-test-suite/Ballerina.toml | 10 + .../Dependencies.toml | 405 +++++++++++++++++ .../Ballerina.toml | 10 + .../Dependencies.toml | 384 ++++++++++++++++ .../Ballerina.toml | 10 + .../Dependencies.toml | 430 ++++++++++++++++++ .../graphql-test-common/Ballerina.toml | 4 + .../graphql-test-common/Dependencies.toml | 381 ++++++++++++++++ 18 files changed, 3768 insertions(+) create mode 100644 ballerina-tests/graphql-advanced-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-advanced-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-client-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-client-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-dataloader-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-interceptor-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-security-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-security-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-service-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-service-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-subgraph-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-subgraph-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-subscription-test-suite/Ballerina.toml create mode 100644 ballerina-tests/graphql-subscription-test-suite/Dependencies.toml create mode 100644 ballerina-tests/graphql-test-common/Ballerina.toml create mode 100644 ballerina-tests/graphql-test-common/Dependencies.toml diff --git a/ballerina-tests/graphql-advanced-test-suite/Ballerina.toml b/ballerina-tests/graphql-advanced-test-suite/Ballerina.toml new file mode 100644 index 000000000..28e552abc --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_advanced_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-advanced-test-suite/Dependencies.toml b/ballerina-tests/graphql-advanced-test-suite/Dependencies.toml new file mode 100644 index 000000000..579b1af0c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/Dependencies.toml @@ -0,0 +1,405 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "constraint", moduleName = "constraint"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_advanced_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "test"} +] +modules = [ + {org = "ballerina", packageName = "graphql_advanced_test_suite", moduleName = "graphql_advanced_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] +modules = [ + {org = "ballerina", packageName = "io", moduleName = "io"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "lang.runtime", moduleName = "lang.runtime"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] +modules = [ + {org = "ballerina", packageName = "mime", moduleName = "mime"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] + diff --git a/ballerina-tests/graphql-client-test-suite/Ballerina.toml b/ballerina-tests/graphql-client-test-suite/Ballerina.toml new file mode 100644 index 000000000..6e3bc23f5 --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_client_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-client-test-suite/Dependencies.toml b/ballerina-tests/graphql-client-test-suite/Dependencies.toml new file mode 100644 index 000000000..50aa2ee08 --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/Dependencies.toml @@ -0,0 +1,413 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_client_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "test"} +] +modules = [ + {org = "ballerina", packageName = "graphql_client_test_suite", moduleName = "graphql_client_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] + diff --git a/ballerina-tests/graphql-dataloader-test-suite/Ballerina.toml b/ballerina-tests/graphql-dataloader-test-suite/Ballerina.toml new file mode 100644 index 000000000..18531950d --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_dataloader_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml b/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml new file mode 100644 index 000000000..d309d6fd9 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml @@ -0,0 +1,422 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_dataloader_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_dataloader_test_suite", moduleName = "graphql_dataloader_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] +modules = [ + {org = "ballerina", packageName = "websocket", moduleName = "websocket"} +] + diff --git a/ballerina-tests/graphql-interceptor-test-suite/Ballerina.toml b/ballerina-tests/graphql-interceptor-test-suite/Ballerina.toml new file mode 100644 index 000000000..e91477044 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_interceptor_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml b/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml new file mode 100644 index 000000000..e4a85adac --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml @@ -0,0 +1,426 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_interceptor_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_interceptor_test_suite", moduleName = "graphql_interceptor_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] +modules = [ + {org = "ballerina", packageName = "log", moduleName = "log"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] +modules = [ + {org = "ballerina", packageName = "websocket", moduleName = "websocket"} +] + diff --git a/ballerina-tests/graphql-security-test-suite/Ballerina.toml b/ballerina-tests/graphql-security-test-suite/Ballerina.toml new file mode 100644 index 000000000..3260a2864 --- /dev/null +++ b/ballerina-tests/graphql-security-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_security_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-security-test-suite/Dependencies.toml b/ballerina-tests/graphql-security-test-suite/Dependencies.toml new file mode 100644 index 000000000..3e38dc6cc --- /dev/null +++ b/ballerina-tests/graphql-security-test-suite/Dependencies.toml @@ -0,0 +1,418 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_security_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "test"} +] +modules = [ + {org = "ballerina", packageName = "graphql_security_test_suite", moduleName = "graphql_security_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] + diff --git a/ballerina-tests/graphql-service-test-suite/Ballerina.toml b/ballerina-tests/graphql-service-test-suite/Ballerina.toml new file mode 100644 index 000000000..ac241275c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_service_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-service-test-suite/Dependencies.toml b/ballerina-tests/graphql-service-test-suite/Dependencies.toml new file mode 100644 index 000000000..c1f9359fb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/Dependencies.toml @@ -0,0 +1,405 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_service_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "url"}, + {org = "ballerina", name = "uuid"} +] +modules = [ + {org = "ballerina", packageName = "graphql_service_test_suite", moduleName = "graphql_service_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "lang.runtime", moduleName = "lang.runtime"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "lang.value", moduleName = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "url", moduleName = "url"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] +modules = [ + {org = "ballerina", packageName = "uuid", moduleName = "uuid"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] + diff --git a/ballerina-tests/graphql-subgraph-test-suite/Ballerina.toml b/ballerina-tests/graphql-subgraph-test-suite/Ballerina.toml new file mode 100644 index 000000000..b5b46506e --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_subgraph_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-subgraph-test-suite/Dependencies.toml b/ballerina-tests/graphql-subgraph-test-suite/Dependencies.toml new file mode 100644 index 000000000..b8f639904 --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/Dependencies.toml @@ -0,0 +1,384 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_subgraph_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "test"} +] +modules = [ + {org = "ballerina", packageName = "graphql_subgraph_test_suite", moduleName = "graphql_subgraph_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] + diff --git a/ballerina-tests/graphql-subscription-test-suite/Ballerina.toml b/ballerina-tests/graphql-subscription-test-suite/Ballerina.toml new file mode 100644 index 000000000..9d17c555d --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/Ballerina.toml @@ -0,0 +1,10 @@ +[package] +org = "ballerina" +name = "graphql_subscription_test_suite" +version = "1.14.1" + +[[dependency]] +org = "ballerina" +name = "graphql_test_common" +repository = "local" +version = "1.14.1" diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml new file mode 100644 index 000000000..a18282fd3 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -0,0 +1,430 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "constraint", moduleName = "constraint"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_subscription_test_suite" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "graphql_test_common"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" +scope = "testOnly" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] +modules = [ + {org = "ballerina", packageName = "lang.runtime", moduleName = "lang.runtime"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.5.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] +modules = [ + {org = "ballerina", packageName = "websocket", moduleName = "websocket"} +] + diff --git a/ballerina-tests/graphql-test-common/Ballerina.toml b/ballerina-tests/graphql-test-common/Ballerina.toml new file mode 100644 index 000000000..c72c15caf --- /dev/null +++ b/ballerina-tests/graphql-test-common/Ballerina.toml @@ -0,0 +1,4 @@ +[package] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" diff --git a/ballerina-tests/graphql-test-common/Dependencies.toml b/ballerina-tests/graphql-test-common/Dependencies.toml new file mode 100644 index 000000000..f8e626c1c --- /dev/null +++ b/ballerina-tests/graphql-test-common/Dependencies.toml @@ -0,0 +1,381 @@ +# AUTO-GENERATED FILE. DO NOT MODIFY. + +# This file is auto-generated by Ballerina for managing dependency versions. +# It should not be modified by hand. + +[ballerina] +dependencies-toml-version = "2" +distribution-version = "2201.10.0" + +[[package]] +org = "ballerina" +name = "auth" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "cache" +version = "3.8.0" +dependencies = [ + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "constraint" +version = "1.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "crypto" +version = "2.7.2" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "file" +version = "1.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "time"} +] +modules = [ + {org = "ballerina", packageName = "file", moduleName = "file"} +] + +[[package]] +org = "ballerina" +name = "graphql" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} +] + +[[package]] +org = "ballerina" +name = "graphql_test_common" +version = "1.14.1" +dependencies = [ + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "graphql"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "test"}, + {org = "ballerina", name = "websocket"} +] +modules = [ + {org = "ballerina", packageName = "graphql_test_common", moduleName = "graphql_test_common"} +] + +[[package]] +org = "ballerina" +name = "http" +version = "2.12.1" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "file"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.decimal"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.regexp"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "mime"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "observe"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] +modules = [ + {org = "ballerina", packageName = "http", moduleName = "http"}, + {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} +] + +[[package]] +org = "ballerina" +name = "io" +version = "1.6.1" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"} +] +modules = [ + {org = "ballerina", packageName = "io", moduleName = "io"} +] + +[[package]] +org = "ballerina" +name = "jballerina.java" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "jwt" +version = "2.13.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "lang.__internal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.array" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"} +] + +[[package]] +org = "ballerina" +name = "lang.decimal" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.int" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.__internal"}, + {org = "ballerina", name = "lang.object"} +] + +[[package]] +org = "ballerina" +name = "lang.object" +version = "0.0.0" + +[[package]] +org = "ballerina" +name = "lang.regexp" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.runtime" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "lang.string" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.regexp"} +] + +[[package]] +org = "ballerina" +name = "lang.value" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "log" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "observe"} +] + +[[package]] +org = "ballerina" +name = "mime" +version = "2.10.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "log"} +] + +[[package]] +org = "ballerina" +name = "oauth2" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, + {org = "ballerina", name = "url"} +] + +[[package]] +org = "ballerina" +name = "observe" +version = "1.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "os" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "task" +version = "2.5.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + +[[package]] +org = "ballerina" +name = "time" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "url" +version = "2.4.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + +[[package]] +org = "ballerina" +name = "uuid" +version = "1.8.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + +[[package]] +org = "ballerina" +name = "websocket" +version = "2.12.0" +dependencies = [ + {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "constraint"}, + {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "jwt"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.runtime"}, + {org = "ballerina", name = "lang.string"}, + {org = "ballerina", name = "lang.value"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "time"} +] +modules = [ + {org = "ballerina", packageName = "websocket", moduleName = "websocket"} +] + From 1196c6a95ce258004d24e68eb2ab31e05e04d148 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Tue, 1 Oct 2024 15:32:26 +0530 Subject: [PATCH 02/15] Refactor tests into structured test suites --- ballerina-tests/Ballerina.toml | 7 - ballerina-tests/Dependencies.toml | 424 --- ballerina-tests/README.md | 40 + ballerina-tests/build.gradle | 106 +- .../object_types.bal | 172 + .../graphql-advanced-test-suite/records.bal | 42 + .../tests/01_context.bal} | 158 +- .../tests/02_file_upload.bal} | 103 +- .../tests/03_field_object.bal} | 13 +- .../tests/04_constraint_validation.bal | 64 + .../tests/05_server_caches.bal | 221 ++ .../tests/06_query_complexity.bal | 86 + .../tests/listeners.bal | 19 + .../tests/object_types.bal | 275 ++ .../tests/records.bal | 115 + .../complexity_with_mutation.graphql | 15 + .../complexity_with_union_types.graphql | 23 + .../resources/documents/constraints.graphql | 46 + .../resources/documents/field_object.graphql | 24 +- .../field_object_parameter_order.graphql | 12 + ...hql_playground_introspection_query.graphql | 99 + .../invalid_complexity_query.graphql | 25 + .../resources/documents/server_cache.graphql | 8 + .../documents/server_cache_eviction.graphql | 12 + .../server_cache_eviction_with_arrays.graphql | 13 + ...er_cache_eviction_with_list_inputs.graphql | 10 + ...ache_eviction_with_nullable_inputs.graphql | 13 + ...er_cache_eviction_with_service_obj.graphql | 18 + .../server_cache_eviction_with_union.graphql | 15 + .../server_cache_fields_with_TTL.graphql | 4 +- .../server_cache_operations_with_TTL.graphql | 8 + ...records_with_non_optional_fields_1.graphql | 0 ...records_with_non_optional_fields_2.graphql | 0 .../server_cache_with_arrays.graphql | 13 + ...erver_cache_with_dynamic_responses.graphql | 44 + .../server_cache_with_errors.graphql | 7 + .../server_cache_with_errors_2.graphql | 18 + .../server_cache_with_input_object.graphql | 12 + .../server_cache_with_inputs.graphql | 25 + .../server_cache_with_list_input.graphql | 63 + .../server_cache_with_list_inputs.graphql | 10 + .../server_cache_with_null_values.graphql | 12 + .../server_cache_with_nullable_inputs.graphql | 13 + ...erver_cache_with_partial_responses.graphql | 27 + .../server_cache_with_records.graphql | 13 + ...server_cache_with_records_eviction.graphql | 18 + ...rver_cache_with_records_operations.graphql | 18 + .../server_cache_with_service_obj.graphql | 18 + .../documents/server_cache_with_union.graphql | 15 + ...ache_with_unions_operational_level.graphql | 31 + .../documents/valid_complexity_query.graphql | 9 + .../complexity_with_mutation.json | 8 + .../complexity_with_union_types.json | 8 + .../expected_results/constraints.json | 10 + .../constraints_configuration.json | 5 + .../constraints_with_intersection_types.json | 10 + .../constraints_with_list_type_inputs.json | 10 + .../constraints_with_mutation.json | 10 + .../constraints_with_variables_1.json | 10 + .../constraints_with_variables_2.json | 10 + .../expected_results/field_object.json | 7 + .../field_object_parameter_order1.json | 7 + .../field_object_parameter_order2.json | 8 + .../field_object_with_multiple_args.json | 8 + ...tion_query_with_complexity_validation.json | 8 + .../invalid_complexity_query.json | 8 + .../expected_results/server_cache_1.json | 6 + .../expected_results/server_cache_10.json | 5 + .../expected_results/server_cache_2.json | 5 + .../expected_results/server_cache_3.json | 6 + .../expected_results/server_cache_4.json | 6 + .../expected_results/server_cache_5.json | 5 + .../expected_results/server_cache_9.json | 6 + .../server_cache_eviction_with_TTL_1.json | 5 + .../server_cache_eviction_with_TTL_2.json | 5 + .../server_cache_eviction_with_TTL_3.json | 5 + ...ver_cache_eviction_with_list_inputs_1.json | 5 + ...ver_cache_eviction_with_list_inputs_2.json | 8 + ...ver_cache_eviction_with_list_inputs_3.json | 5 + ...cache_eviction_with_nullable_inputs_1.json | 8 + ...cache_eviction_with_nullable_inputs_2.json | 8 + ...cache_eviction_with_nullable_inputs_3.json | 8 + ...he_records_with_non_optional_fields_1.json | 5 + ...he_records_with_non_optional_fields_2.json | 9 + ...he_records_with_non_optional_fields_3.json | 5 + .../server_cache_with_arrays_1.json | 10 + .../server_cache_with_arrays_2.json | 8 + .../server_cache_with_arrays_3.json | 10 + .../server_cache_with_arrays_4.json | 11 + .../server_cache_with_arrays_5.json | 10 + .../server_cache_with_arrays_6.json | 11 + .../server_cache_with_arrays_7.json | 10 + ...server_cache_with_dynamic_responses_1.json | 7 + ...server_cache_with_dynamic_responses_2.json | 8 + ...server_cache_with_dynamic_responses_3.json | 9 + ...server_cache_with_dynamic_responses_4.json | 9 + ...server_cache_with_dynamic_responses_5.json | 9 + ...server_cache_with_dynamic_responses_6.json | 8 + ...server_cache_with_dynamic_responses_7.json | 9 + ...server_cache_with_dynamic_responses_8.json | 8 + .../server_cache_with_empty_input_1.json | 5 + .../server_cache_with_empty_input_2.json | 5 + .../server_cache_with_errors_1.json | 10 + .../server_cache_with_errors_2.json | 5 + .../server_cache_with_errors_3.json | 8 + .../server_cache_with_errors_4.json | 10 + .../server_cache_with_errors_5.json | 8 + .../server_cache_with_input_object_1.json | 8 + .../server_cache_with_input_object_2.json | 7 + .../server_cache_with_input_object_3.json | 8 + .../server_cache_with_list_input_1.json | 5 + .../server_cache_with_list_input_2.json | 5 + .../server_cache_with_list_input_3.json | 9 + .../server_cache_with_list_input_4.json | 5 + .../server_cache_with_list_input_5.json | 9 + .../server_cache_with_list_input_6.json} | 6 +- .../server_cache_with_list_input_7.json | 5 + .../server_cache_with_list_input_8.json | 5 + .../server_cache_with_null_values_1.json | 5 + .../server_cache_with_null_values_2.json | 7 + .../server_cache_with_null_values_3.json | 8 + .../server_cache_with_nullable_inputs_1.json | 9 + .../server_cache_with_nullable_inputs_2.json | 8 + .../server_cache_with_nullable_inputs_7.json | 5 + .../server_cache_with_nullable_inputs_8.json | 5 + .../server_cache_with_partial_reponses_1.json | 7 + .../server_cache_with_partial_reponses_2.json | 7 + .../server_cache_with_partial_reponses_3.json | 7 + .../server_cache_with_rec_1.json | 8 + .../server_cache_with_rec_2.json | 8 + .../server_cache_with_rec_3.json | 8 + .../server_cache_with_rec_4.json | 9 + .../server_cache_with_rec_5.json | 8 + .../server_cache_with_svc_obj_1.json | 8 + .../server_cache_with_svc_obj_2.json | 8 + .../server_cache_with_svc_obj_3.json | 8 + .../server_cache_with_union_1.json | 5 + .../server_cache_with_union_2.json | 8 + .../server_cache_with_union_3.json | 8 + .../server_cache_with_union_4.json | 9 + .../server_cache_with_unions_1.json | 8 + .../server_cache_with_unions_2.json | 8 + .../server_cache_with_unions_3.json | 8 + .../valid_complexity_query.json | 9 + .../tests/resources/files/sample1.json | 3 + .../tests/resources/files/sample2.txt | 0 .../tests/resources/files/sample3.xml | 0 .../tests/services.bal | 664 ++++ .../tests/values.bal | 53 + .../graphql-advanced-test-suite/values.bal | 29 + .../tests/01_client_test.bal} | 293 +- .../tests/listeners.bal | 19 + .../tests/records.bal | 166 + .../tests/resources/documents/alias.graphql | 10 + .../fragments_on_record_objects.graphql | 9 + .../documents/inline_fragment.graphql | 17 + ..._without_operation_name_in_request.graphql | 11 + .../documents/nested_fragments.graphql | 18 +- .../fragments_on_record_objects.json | 15 + .../expected_results/inline_fragment.json | 32 + .../expected_results/nested_fragments.json | 21 + .../tests/services.bal | 102 + .../tests/values.bal | 117 + .../tests/01_dataloader_tests.bal} | 84 +- .../tests/02_dataloader_with_server_cache.bal | 64 + .../tests/batch_load_functions.bal | 0 .../tests/interceptors.bal | 37 + .../tests/listeners.bal | 21 + .../tests/object_types.bal | 110 + .../tests/records.bal | 26 + .../batch_function_returing_errors.graphql | 0 ...ning_non_matcing_number_of_results.graphql | 0 ...ith_different_alias_for_same_field.graphql | 0 .../dataloader_with_interceptor.graphql | 0 .../dataloader_with_mutation.graphql | 0 .../documents/dataloader_with_query.graphql | 0 .../dataloader_with_subscription.graphql | 0 ...ver_cache_eviction_with_dataloader.graphql | 2 +- ...iction_with_dataloader_operational.graphql | 2 +- .../server_cache_with_dataloader.graphql | 2 +- ..._cache_with_dataloader_operational.graphql | 2 +- .../batch_function_returing_errors.json | 7 +- ...turning_non_matcing_number_of_results.json | 0 .../data_loader_with_subscription.json | 0 ...r_with_different_alias_for_same_field.json | 32 + .../dataloader_with_interceptor.json | 6 + .../dataloader_with_mutation.json | 19 + .../dataloader_with_query.json | 28 + .../server_cache_with_dataloader_1.json | 28 + .../server_cache_with_dataloader_2.json | 19 + .../server_cache_with_dataloader_3.json | 28 + .../server_cache_with_dataloader_4.json | 28 + .../server_cache_with_dataloader_5.json | 19 + .../tests/services.bal | 187 + .../tests/utils.bal | 51 + .../tests/values.bal | 64 + .../tests/01_interceptor_tests.bal} | 207 +- .../02_interceptors_with_server_cache.bal | 54 + .../tests/interceptors.bal | 1 - .../tests/listeners.bal | 20 + .../tests/object_types.bal | 171 + .../tests/records.bal | 58 + .../documents/duplicate_interceptors.graphql | 3 + ...te_same_interceptor_multiple_times.graphql | 3 + .../interceptor_execution_order.graphql | 4 + .../resources/documents/interceptors.graphql | 3 + .../interceptors_returning_error1.graphql | 3 + .../interceptors_returning_error2.graphql | 3 + .../interceptors_returning_error3.graphql} | 2 + ...errors_with_hierarchical_resources.graphql | 9 + ...terceptors_returning_invalid_value.graphql | 4 + .../interceptors_with_arrays.graphql | 3 + ...ors_with_destructive_modification1.graphql | 11 + ...ors_with_destructive_modification2.graphql | 10 + .../documents/interceptors_with_enum.graphql | 3 + .../interceptors_with_fragments.graphql | 11 + ...rs_with_fragments_and_subscription.graphql | 29 + ...terceptors_with_hierarchical_paths.graphql | 6 + ..._invalid_destructive_modification1.graphql | 3 + ..._invalid_destructive_modification2.graphql | 3 + ..._invalid_destructive_modification3.graphql | 8 + ..._invalid_destructive_modification4.graphql | 6 + .../documents/interceptors_with_map.graphql | 14 + .../interceptors_with_mutation.graphql | 9 + .../interceptors_with_null_value1.graphql | 3 + .../interceptors_with_null_value2.graphql | 4 + .../interceptors_with_record_fields.graphql | 15 + .../interceptors_with_records.graphql | 13 + ...ceptors_with_records_and_fragments.graphql | 18 + .../interceptors_with_service_object.graphql | 11 + ...s_with_subscription_return_records.graphql | 13 + ...ith_subscription_return_union_type.graphql | 22 + .../documents/interceptors_with_table.graphql | 8 + .../documents/interceptors_with_union.graphql | 15 + .../documents/resource_interceptors.graphql | 14 + ...r_cache_eviction_with_interceptors.graphql | 7 + .../server_cache_with_interceptors.graphql | 7 + .../duplicate_interceptors.json | 5 + ...ecute_same_interceptor_multiple_times.json | 5 + .../interceptor_execution_order.json | 6 + .../expected_results/interceptors.json | 5 + .../interceptors_returning_error1.json | 10 + .../interceptors_returning_error2.json | 10 + .../interceptors_returning_error3.json | 10 + ...ng_errors_with_hierarchical_resources.json | 33 + .../interceptors_returning_invalid_value.json | 15 + .../interceptors_with_arrays.json | 10 + ...eptors_with_destructive_modification1.json | 8 + ...eptors_with_destructive_modification2.json | 6 + .../interceptors_with_enum.json | 5 + .../interceptors_with_fragments.json | 9 + .../interceptors_with_hierarchical_paths.json | 8 + ...ith_invalid_destructive_modification1.json | 25 + ...ith_invalid_destructive_modification2.json | 20 + ...ith_invalid_destructive_modification3.json | 25 + ...ith_invalid_destructive_modification4.json | 20 + .../interceptors_with_map.json | 16 + .../interceptors_with_mutation.json | 11 + .../interceptors_with_null_value1.json | 5 + .../interceptors_with_null_value2.json | 6 + .../interceptors_with_record_fields.json | 21 + .../interceptors_with_records.json | 15 + ...terceptors_with_records_and_fragments.json | 21 + .../interceptors_with_service_object.json | 13 + .../interceptors_with_table.json | 14 + .../interceptors_with_union.json | 13 + .../resource_interceptors.json | 21 + .../server_cache_with_interceptors_1.json | 5 + .../server_cache_with_interceptors_2.json | 5 + .../server_cache_with_interceptors_3.json | 5 + .../tests/services.bal | 662 ++++ .../tests/values.bal | 35 + .../tests/01_auth_listener_configs.bal} | 52 +- .../tests/02_graphiql_secure_endpoint.bal | 42 + .../tests/03_client_security.bal | 42 + .../tests/Config.toml | 0 .../tests/listeners.bal | 28 + .../tests/resources/cert/public.crt | 0 .../tests/resources/key/private.key | 0 .../resources/keystore/ballerinaKeystore.p12 | Bin .../keystore/ballerinaTruststore.p12 | Bin .../tests/services.bal | 172 + .../tests/utils.bal} | 9 +- .../custom_prefix_without_import.bal | 0 .../object_types.bal} | 185 - .../services.bal | 54 - .../tests/01_listener_test.bal | 80 +- .../tests/02_request_validation.bal | 148 + .../tests/03_document_validation.bal | 5 +- .../tests/04_input_parameters.bal | 19 +- .../tests/05_record_objects.bal | 9 +- .../tests/06_runtime_errors.bal | 13 +- .../tests/07_service_objects.bal | 9 +- .../tests/08_arrays.bal} | 17 +- .../tests/09_introspection_queries.bal} | 10 +- .../tests/10_configurations_test.bal} | 18 +- .../tests/11_hierarchical_resource_paths.bal} | 9 +- .../tests/12_tables.bal} | 9 +- .../tests/13_fragments.bal} | 9 +- .../tests/14_enums.bal} | 11 +- .../tests/15_maps.bal} | 13 +- .../tests/16_recursive_types.bal} | 9 +- .../tests/17_distinct_service_unions.bal} | 9 +- .../18_document_with_duplicate_fields.bal} | 9 +- .../tests/19_aliases.bal} | 9 +- .../tests/20_variables.bal} | 17 +- .../tests/21_mutations.bal} | 9 +- .../tests/22_block_strings.bal} | 7 +- .../tests/23_input_objects.bal} | 25 +- .../tests/24_nullable_values.bal} | 9 +- .../tests/25_directives.bal} | 13 +- .../tests/26_list_type_inputs.bal} | 33 +- .../tests/27_intersection_types.bal} | 9 +- .../tests/28_decimal_type.bal} | 43 +- .../tests/29_nullable_inputs.bal} | 9 +- .../tests/30_graphiql_client.bal} | 36 +- .../tests/31_interfaces.bal} | 9 +- .../tests/32_id_input_type_validation.bal} | 13 +- .../tests/listeners.bal} | 17 +- .../tests/object_types.bal | 284 +- .../tests/records.bal | 98 +- .../tests/resources/documents/alias.graphql | 10 + .../documents/alias_on_error_path.graphql | 7 + .../alias_on_hierarchical_resources.graphql | 7 + .../alias_on_service_objects_union.graphql | 13 + .../alias_with_invalid_field_name.graphql | 8 + ...arrays_with_errors_in_record_field.graphql | 8 + ...h_mutation_to_http2_based_listener.graphql | 5 + ...with_query_to_http1_based_listener.graphql | 5 + ...with_query_to_http2_based_listener.graphql | 5 + ...h_mutation_to_http1_based_listener.graphql | 5 + ...ballerina_record_as_graphql_object.graphql | 8 + .../resources/documents/block_strings.graphql | 11 + .../block_strings_with_double_quotes.graphql | 11 + ...ock_strings_with_escaped_character.graphql | 7 +- ...trings_with_variable_default_value.graphql | 2 +- .../documents/coerce_decimal_to_float.graphql | 2 +- .../coerce_int_input_to_float.graphql | 3 + .../documents/coerce_int_to_decimal.graphql | 3 + ..._int_to_decimal_with_default_value.graphql | 2 +- ...int_to_decimal_with_variable_input.graphql | 2 +- .../complex_introspection_query.graphql | 8 + ...rospection_query_with_other_fields.graphql | 11 + .../documents/complex_service.graphql | 8 + .../documents/decimal_type_input.graphql | 3 + .../documents/decimal_type_list_input.graphql | 3 + ...cimal_type_list_with_default_input.graphql | 5 + ...imal_type_list_with_variable_input.graphql | 2 +- ...pe_with_input_object_default_value.graphql | 8 + ...al_type_with_input_object_variable.graphql | 2 +- .../decimal_with_negative_infinity.graphql | 3 + .../decimal_with_negative_zero.graphql | 2 +- .../decimal_with_positive_infinity.graphql | 3 + ...ault_values_in_input_object_fields.graphql | 3 + .../deprecated_fields_filtering.graphql | 38 + ...ed_fields_filtering_with_variables.graphql | 38 + .../deprecated_fields_introspection.graphql | 45 + ...ields_introspection_with_variables.graphql | 38 + .../documents/directive_locations.graphql | 7 + .../resources/documents/directives.graphql | 14 + .../directives_skip_all_selections.graphql | 5 + .../directives_with_duplicate_fields.graphql | 20 + ...th_service_returning_objects_array.graphql | 7 + ...tives_with_variables_and_fragments.graphql | 22 + .../resources/documents/documentation.graphql | 48 + .../duplicate_fields_with_arguments.graphql | 149 + ...duplicate_fields_with_record_types.graphql | 22 + .../duplicate_inline_fragments.graphql | 25 + .../duplicate_input_variables.graphql | 2 +- ...variables_with_multiple_operations.graphql | 19 + .../documents/empty_block_string.graphql | 6 + ...pty_list_type_within_input_objects.graphql | 11 + ...ithin_input_objects_with_variables.graphql | 6 + .../resources/documents/empty_string.graphql | 3 + .../tests/resources/documents/enum.graphql | 5 + .../documents/enum_input_parameter.graphql | 3 + .../enum_input_parameter_as_string.graphql | 3 + .../documents/enum_inside_record.graphql | 3 + .../documents/enum_introspection.graphql | 10 + .../enum_invalid_input_parameter.graphql | 3 + ..._type_default_value_with_variables.graphql | 2 +- .../documents/enum_type_variables.graphql | 2 +- .../enum_value_introspection.graphql | 7 + .../documents/enum_with_union.graphql | 3 + .../enum_with_values_assigned.graphql | 3 + ...th_values_assigned_using_variables.graphql | 2 +- .../documents/float_as_input.graphql | 3 + ...t_type_variable_with_default_value.graphql | 2 +- .../fragment_on_invalid_type.graphql | 4 +- .../fragment_with_invalid_field.graphql | 9 + ..._fragments_when_returning_services.graphql | 12 +- .../fragments_on_record_objects.graphql | 9 + ...fragments_querying_service_objects.graphql | 16 +- .../fragments_with_input_variables.graphql | 15 + .../fragments_with_introspection.graphql | 16 +- ...agments_with_invalid_introspection.graphql | 16 +- ..._with_multiple_resource_invocation.graphql | 23 + .../functions_with_input_parameter.graphql} | 4 +- ...hql_playground_introspection_query.graphql | 99 + ..._paths_same_type_in_multiple_paths.graphql | 9 + .../hierarchical_resource_paths.graphql | 7 + ...erarchical_resource_paths_complete.graphql | 9 + ...hical_resource_paths_introspection.graphql | 10 + ...es_with_hierarchical_resource_path.graphql | 9 + ...ical_resource_paths_with_fragments.graphql | 16 + ...esource_paths_with_multiple_fields.graphql | 8 + ..._paths_with_same_field_repeating_1.graphql | 9 + ...paths_with_same_field_repeating_2.graphql} | 2 + .../id_input_type_validation_decimal.graphql | 3 + ...nput_type_validation_decimal_array.graphql | 7 + ...put_type_validation_decimal_or_nil.graphql | 3 + .../id_input_type_validation_float.graphql | 3 + ..._input_type_validation_float_array.graphql | 7 + ...input_type_validation_float_array1.graphql | 7 + ...input_type_validation_float_or_nil.graphql | 3 + .../id_input_type_validation_int.graphql | 3 + .../id_input_type_validation_int1.graphql | 7 + ...id_input_type_validation_int_array.graphql | 7 + ...d_input_type_validation_int_or_nil.graphql | 3 + ...nput_type_validation_return_record.graphql | 7 + ...ype_validation_return_record_array.graphql | 7 + .../id_input_type_validation_string.graphql | 3 + ...input_type_validation_string_array.graphql | 7 + ...nput_type_validation_string_or_nil.graphql | 3 + .../id_input_type_validation_uuid.graphql | 9 + ...d_input_type_validation_uuid_array.graphql | 11 + ..._type_validation_uuid_array_or_nil.graphql | 11 + .../documents/id_introspection_query.graphql | 41 + .../documents/inline_fragment.graphql | 17 + ...inline_fragments_on_record_objects.graphql | 12 + .../inline_fragments_with_variables.graphql | 14 + ...nested_fragments_on_record_objects.graphql | 22 + .../resources/documents/input_object.graphql | 5 + ...lude_fields_with_complex_variables.graphql | 12 + ...de_fields_with_undefined_variables.graphql | 11 + ...ject_include_fields_with_variables.graphql | 12 + ...t_type_variables_inside_list_value.graphql | 5 + ...t_variables_with_invalid_type_name.graphql | 2 +- .../input_object_with_default_value.graphql | 15 + ...input_object_with_duplicate_fields.graphql | 13 + ...put_object_with_enum_type_argument.graphql | 2 +- ...t_object_with_float_type_variables.graphql | 2 +- ...object_with_fragment_and_variables.graphql | 21 + ...ith_inline_fragment_with_variables.graphql | 16 + ...put_object_with_invalid_arguments1.graphql | 5 + ...put_object_with_invalid_arguments2.graphql | 12 + ...bject_with_invalid_type_variables1.graphql | 2 +- ...bject_with_invalid_type_variables2.graphql | 16 + ...nput_object_with_missing_arguments.graphql | 5 + ...th_missing_nullable_variable_value.graphql | 16 + ...t_with_missing_variables_arguments.graphql | 12 + ...with_nested_input_object_variables.graphql | 2 +- .../input_object_with_nested_object.graphql | 13 + ...input_object_with_undefined_fields.graphql | 12 + ...ct_with_unexpected_variable_values.graphql | 16 + .../input_object_with_variables.graphql | 2 +- ...put_object_without_optional_fields.graphql | 11 + ...r_type_not_present_in_return_types.graphql | 3 + .../input_with_escape_characters.graphql | 3 + .../input_with_unicode_characters.graphql | 3 + .../documents/interface_field.graphql | 5 + .../documents/interface_introspection.graphql | 12 + .../resources/documents/interfaces.graphql | 16 + ...plementing_interface_introsepction.graphql | 0 ...terfaces_with_interface_type_array.graphql | 13 + .../interfaces_with_invalid_field.graphql | 20 + .../interfaces_with_nested_fragments.graphql | 16 +- ...faces_with_type_name_introspection.graphql | 20 + .../documents/intersection_types.graphql | 0 ...t_object_having_defaultable_fields.graphql | 0 ...tion_on_inputs_with_default_values.graphql | 0 ...tion_on_service_with_input_objects.graphql | 13 + ...ction_query_with_missing_selection.graphql | 3 + .../documents/invalid_block_strings.graphql | 2 +- ..._type_default_value_with_variables.graphql | 2 +- ...nvalid_hierarchical_resource_paths.graphql | 8 + .../invalid_introspection_query.graphql | 5 + ...nvalid_list_type_for_input_objects.graphql | 13 + ...lid_list_type_within_input_objects.graphql | 11 + ...ithin_input_objects_with_variables.graphql | 6 + .../documents/invalid_mutation.graphql | 2 +- ...query_from_service_object_resource.graphql | 7 + ...query_with_distinct_service_unions.graphql | 5 + ...invalid_schema_introspection_field.graphql | 10 + .../invalid_spread_inline_fragments.graphql | 12 + ..._with_nested_list_in_input_objects.graphql | 11 + ...nvalid_variables_inside_list_value.graphql | 6 + .../documents/list_type_input.graphql | 3 + .../list_type_input_with_empty_value.graphql | 3 + ..._type_input_with_invalid_variables.graphql | 2 +- .../list_type_input_with_null_value.graphql | 3 + .../list_type_input_with_variable.graphql | 3 + .../list_type_inputs_with_nested_list.graphql | 3 + ...t_type_variables_inside_list_value.graphql | 3 + ..._type_variables_with_input_objects.graphql | 5 + ...riables_with_invalid_input_objects.graphql | 5 + ...nvalid_nested_list_in_input_object.graphql | 5 + ...s_with_nested_list_in_input_object.graphql | 5 + .../list_type_with_default_value.graphql | 3 + .../list_type_with_enum_values.graphql | 3 + .../list_type_with_input_objects.graphql | 7 + ...list_type_with_invalid_enum_values.graphql | 3 + ...e_with_invalid_input_objects_value.graphql | 10 + ...nvalid_nested_list_in_input_object.graphql | 15 + ..._invalid_variable_default_values_1.graphql | 2 +- ..._invalid_variable_default_values_2.graphql | 2 +- ..._invalid_variable_default_values_3.graphql | 2 +- ..._invalid_variable_default_values_4.graphql | 3 + ..._invalid_variable_default_values_5.graphql | 2 +- ..._invalid_variable_default_values_6.graphql | 2 +- ..._invalid_variable_default_values_7.graphql | 6 + ..._invalid_variable_default_values_8.graphql | 3 + ..._invalid_variable_default_values_9.graphql | 3 + ...e_with_nested_list_in_input_object.graphql | 15 + ...ype_with_variable_default_values_1.graphql | 2 +- ...ype_with_variable_default_values_2.graphql | 2 +- ...ype_with_variable_default_values_3.graphql | 2 +- ...ype_with_variable_default_values_4.graphql | 2 +- ...ype_with_variable_default_values_5.graphql | 11 + ...ype_with_variable_default_values_6.graphql | 11 + ...ype_with_variable_default_values_7.graphql | 16 + ...ype_with_variable_default_values_8.graphql | 11 + ...ype_with_variable_default_values_9.graphql | 2 +- .../list_type_within_input_objects.graphql | 8 + ...ithin_input_objects_with_variables.graphql | 6 + .../tests/resources/documents/map.graphql | 7 + .../documents/map_with_invalid_key.graphql | 8 + .../documents/map_with_valid_key.graphql | 5 + .../documents/map_without_key_input.graphql | 7 + ...multiple_directive_usage_in_fields.graphql | 10 + .../documents/multiple_mutations.graphql | 14 + ...tiple_mutations_on_service_objects.graphql | 10 + ..._without_operation_name_in_request.graphql | 11 + ...e_variable_types_with_single_query.graphql | 13 + .../resources/documents/mutation.graphql | 5 + ...tion_request_on_non_mutable_schema.graphql | 5 + .../mutation_type_introspection.graphql | 10 + ...ed_fragments_with_duplicate_fields.graphql | 37 + .../documents/nested_fragments.graphql | 23 + ...rvice_objects_with_multiple_fields.graphql | 14 +- ...d_list_input_with_invalid_values_1.graphql | 3 + ...d_list_input_with_invalid_values_2.graphql | 3 + .../resources/documents/nested_map.graphql | 9 + .../nested_map_without_key_input.graphql | 7 + .../documents/nested_records_array.graphql | 11 + .../non_null_input_for_nullable_list.graphql | 8 + ...non_null_input_for_nullable_record.graphql | 5 + ...ll_input_for_nullable_record_field.graphql | 3 + ...e_variable_with_empty_list_value_1.graphql | 6 + ...e_variable_with_empty_list_value_2.graphql | 6 + ...pe_variables_with_nullable_rgument.graphql | 2 +- .../documents/null_as_enum_input.graphql | 3 + ..._as_enum_input_with_variable_value.graphql | 2 +- .../null_as_resource_function_name.graphql | 3 + .../documents/null_as_scalar_input.graphql | 5 + ...s_scalar_input_with_variable_value.graphql | 2 +- ...ll_input_for_nullable_record_field.graphql | 3 + ...ll_value_for_defaultable_arguments.graphql | 5 + ...efaultable_arguments_with_variable.graphql | 5 + .../null_value_for_non_null_argument.graphql | 3 + ..._null_argument_with_variable_value.graphql | 2 +- ...object_with_error_added_to_context.graphql | 3 + ...e_input_object_with_variable_value.graphql | 2 +- ...ble_list_type_input_with_variables.graphql | 2 +- .../null_value_in_input_object_field.graphql | 5 + ...t_object_field_with_variable_value.graphql | 2 +- ..._in_list_type_input_with_variables.graphql | 2 +- .../nullable_input_for_nullable_list.graphql | 3 + ...nullable_input_for_nullable_record.graphql | 3 + ...list_type_input_with_invalid_value.graphql | 3 + ...able_list_type_input_without_value.graphql | 3 + ...ices_array_query_on_selected_types.graphql | 7 + .../nullable_variables_without_value.graphql | 2 +- ...optional_arrays_with_invalid_query.graphql | 3 + .../optional_enum_argument_with_value.graphql | 3 + ...tional_enum_argument_without_value.graphql | 3 + .../query_type_introspection.graphql | 10 + .../query_with_default_parameter.graphql | 3 + .../query_without_default_parameter.graphql | 3 + .../querying_subfields_on_type_name.graphql | 7 + .../querying_table_without_selections.graphql | 3 + .../documents/record_type_arrays.graphql | 8 + .../documents/request_invalid_field.graphql | 5 + ...invalid_field_from_service_objects.graphql | 11 + .../requesting_object_without_fields.graphql | 3 + ...ing_list_of_nested_service_objects.graphql | 8 + ...r_returning_map_of_service_objects.graphql | 7 + ...ng_table_of_nested_service_objects.graphql | 8 + .../resolver_returning_tables.graphql | 5 + ...olver_returning_tables_with_errors.graphql | 5 + ...ce_returning_arrays_missing_fields.graphql | 3 + ...ing_optional_service_object_arrays.graphql | 7 + .../resource_returning_service_object.graphql | 5 + ...rce_returning_service_object_array.graphql | 5 + .../resource_returning_tables.graphql | 5 + .../documents/returning_enum_array.graphql | 3 + .../returning_enum_array_with_errors.graphql | 3 + ...ng_nullable_enum_array_with_errors.graphql | 3 + .../returning_recursive_service_type.graphql | 5 + ...returning_union_of_service_objects.graphql | 14 + .../same_field_with_multiple_alias.graphql | 14 + ...multiple_alias_different_subfields.graphql | 14 + .../resources/documents/scalar_arrays.graphql | 3 + .../scalar_arrays_with_errors.graphql | 3 + ...scalar_nullable_arrays_with_errors.graphql | 3 + ...rray_with_fragment_returning_error.graphql | 10 + ..._array_with_invalid_response_order.graphql | 10 + ...ice_object_defined_as_record_field.graphql | 8 + .../service_with_other_annotations.graphql | 3 + .../test_quering_on_interface.graphql | 0 ...g_fragment_on_transitive_interface.graphql | 0 .../test_querying_on_transitive_type.graphql | 0 ...g_on_transitive_type_and_interface.graphql | 0 .../documents/type_introspection.graphql | 8 + ...pe_introspection_in_invalid_place.graphql} | 4 +- ...introspection_on_non_existing_type.graphql | 5 + .../type_introspection_with_alias.graphql | 6 + .../type_introspection_without_fields.graphql | 3 + ...pection_without_type_name_argument.graphql | 8 + ...pe_name_introspection_in_fragments.graphql | 15 + ...n_nullable_union_of_service_types.graphql} | 14 +- ...pe_name_introspection_on_operation.graphql | 3 + ...ame_introspection_on_record_types.graphql} | 2 + ...ame_introspection_on_service_types.graphql | 6 + ...spection_on_union_of_service_types.graphql | 15 + .../typename_introspection_on_field.graphql | 9 + .../typename_introspection_on_scalar.graphql | 7 + ...rospection_on_schema_introspection.graphql | 0 ...ename_introspection_on_type_record.graphql | 5 + .../union_of_distinct_service_objects.graphql | 11 + ...ices_array_query_on_selected_types.graphql | 7 + ...on_selected_types_fragment_on_root.graphql | 9 + ...t_services_query_on_selected_types.graphql | 7 + .../documents/union_type_names.graphql | 25 + ...on_types_with_field_returning_enum.graphql | 8 + ...ject_includes_field_returning_enum.graphql | 11 + .../documents/unknown_inline_fragment.graphql | 5 + ...lue_with_coerce_int_input_to_float.graphql | 2 +- .../variables_inside_list_value.graphql | 15 + ...les_with_coerce_int_input_to_float.graphql | 2 +- .../variables_with_default_null_value.graphql | 2 +- .../variables_with_default_values.graphql | 15 + ...variables_with_multiple_operations.graphql | 13 + .../variables_with_nested_map.graphql | 9 + .../variables_with_query_and_mutation.graphql | 10 + .../resources/expected_results/alias.json | 12 + .../expected_results/alias_on_error_path.json | 10 + .../alias_on_hierarchical_resources.json | 9 + .../alias_on_service_objects_union.json | 10 + .../alias_with_invalid_field_name.json | 8 + .../arrays_with_errors_in_record_field.json | 17 + ...with_mutation_to_http2_based_listener.json | 7 + ...ce_with_query_to_http1_based_listener.json | 7 + ...ce_with_query_to_http2_based_listener.json | 7 + ...with_mutation_to_http1_based_listener.json | 7 + .../ballerina_record_as_graphql_object.json | 10 + .../expected_results/block_strings.json | 5 + .../block_strings_with_double_quotes.json | 5 + .../block_strings_with_escaped_character.json | 5 + ...k_strings_with_variable_default_value.json | 5 + .../coerce_decimal_to_float.json | 5 + .../coerce_int_input_to_float.json | 5 + .../coerce_int_to_decimal.json | 5 + ...rce_int_to_decimal_with_default_value.json | 5 + ...ce_int_to_decimal_with_variable_input.json | 5 + .../complex_introspection_query.json | 25 + ...introspection_query_with_other_fields.json | 26 + .../expected_results/complex_service.json | 10 + .../expected_results/decimal_type_input.json | 5 + .../decimal_type_list_input.json | 5 + .../decimal_type_list_with_default_input.json | 5 + ...decimal_type_list_with_variable_input.json | 5 + ..._type_with_input_object_default_value.json | 5 + ...cimal_type_with_input_object_variable.json | 5 + .../decimal_with_negative_infinity.json | 8 + .../decimal_with_negative_zero.json | 5 + .../decimal_with_positive_infinity.json | 8 + ...default_values_in_input_object_fields.json | 5 + .../deprecated_fields_filtering.json | 121 + ...cated_fields_filtering_with_variables.json | 121 + .../deprecated_fields_introspection.json | 244 ++ ...d_fields_introspection_with_variables.json | 207 ++ .../expected_results/directive_locations.json | 11 + .../expected_results/directives.json | 9 + .../directives_skip_all_selections.json | 1 + .../directives_with_duplicate_fields.json | 10 + ..._with_service_returning_objects_array.json | 5 + ...rectives_with_variables_and_fragments.json | 10 + .../expected_results/documentation.json | 80 + .../duplicate_fields_with_enum_args_1.json | 11 + .../duplicate_fields_with_enum_args_2.json | 11 + .../duplicate_fields_with_enum_args_3.json | 11 + ...icate_fields_with_input_object_args_1.json | 11 + ...icate_fields_with_input_object_args_2.json | 11 + ...icate_fields_with_input_object_args_3.json | 11 + ...icate_fields_with_input_object_args_4.json | 18 + .../duplicate_fields_with_list_args_1.json | 12 + .../duplicate_fields_with_list_args_2.json | 18 + .../duplicate_fields_with_list_args_3.json | 21 + .../duplicate_fields_with_record_types.json | 14 + .../duplicate_fields_with_scalar_args_1.json | 18 + .../duplicate_fields_with_scalar_args_2.json | 11 + .../duplicate_fields_with_scalar_args_3.json | 11 + .../duplicate_inline_fragments.json | 32 + .../duplicate_input_variables.json | 8 + ...te_variables_with_multiple_operations.json | 9 + .../expected_results/empty_block_string.json | 5 + .../empty_list_type_within_input_objects.json | 15 + ...e_within_input_objects_with_variables.json | 15 + .../expected_results/empty_string.json | 5 + .../resources/expected_results/enum.json | 7 + .../enum_input_parameter.json | 5 + .../enum_input_parameter_as_string.json | 8 + .../expected_results/enum_inside_record.json | 5 + .../expected_results/enum_introspection.json | 90 + .../enum_invalid_input_parameter.json | 8 + ...num_type_default_value_with_variables.json | 5 + .../expected_results/enum_type_variables.json | 5 + .../enum_value_introspection.json | 8 + .../expected_results/enum_with_union.json | 10 + .../enum_with_values_assigned.json | 5 + ..._with_values_assigned_using_variables.json | 5 + .../expected_results/float_as_input.json | 5 + ...loat_type_variable_with_default_value.json | 5 + .../fragment_on_invalid_type.json | 8 + .../fragment_with_invalid_field.json | 8 + ...ide_fragments_when_returning_services.json | 7 + .../fragments_on_record_objects.json | 9 + .../fragments_querying_service_objects.json | 9 + .../fragments_with_input_variables.json | 9 + .../fragments_with_introspection.json | 25 + .../fragments_with_invalid_introspection.json | 8 + ...nts_with_multiple_resource_invocation.json | 26 + .../functions_with_input_parameter.json | 5 + ...raphql_playground_introspection_query.json | 1464 ++++++++ ...cal_paths_same_type_in_multiple_paths.json | 1 + .../hierarchical_resource_paths.json | 9 + .../hierarchical_resource_paths_complete.json | 11 + ...archical_resource_paths_introspection.json | 101 + ...vices_with_hierarchical_resource_path.json | 11 + ...rchical_resource_paths_with_fragments.json | 10 + ...l_resource_paths_with_multiple_fields.json | 10 + ...rce_paths_with_same_field_repeating_1.json | 11 + ...rce_paths_with_same_field_repeating_2.json | 7 + .../id_input_type_validation_decimal.json | 5 + ...d_input_type_validation_decimal_array.json | 9 + ..._input_type_validation_decimal_or_nil.json | 5 + .../id_input_type_validation_float.json | 5 + .../id_input_type_validation_float_array.json | 9 + ...id_input_type_validation_float_array1.json | 9 + ...id_input_type_validation_float_or_nil.json | 5 + .../id_input_type_validation_int.json | 5 + .../id_input_type_validation_int1.json | 9 + .../id_input_type_validation_int_array.json | 9 + .../id_input_type_validation_int_or_nil.json | 5 + ...d_input_type_validation_return_record.json | 9 + ...t_type_validation_return_record_array.json | 9 + .../id_input_type_validation_string.json | 5 + ...id_input_type_validation_string_array.json | 9 + ...d_input_type_validation_string_or_nil.json | 5 + .../id_input_type_validation_uuid.json | 9 + .../id_input_type_validation_uuid_array.json | 9 + ...put_type_validation_uuid_array_or_nil.json | 9 + .../id_introspection_query.json | 635 ++++ .../expected_results/inline_fragment.json | 26 + .../inline_fragments_on_record_objects.json | 10 + .../inline_fragments_with_variables.json | 10 + ...ne_nested_fragments_on_record_objects.json | 16 + .../expected_results/input_object.json | 7 + ...include_fields_with_complex_variables.json | 8 + ...clude_fields_with_undefined_variables.json | 8 + ..._object_include_fields_with_variables.json | 8 + ...ject_type_variables_inside_list_value.json | 9 + ...ject_variables_with_invalid_type_name.json | 8 + .../input_object_with_default_value.json | 8 + .../input_object_with_duplicate_fields.json | 8 + .../input_object_with_enum_type_argument.json | 5 + ...nput_object_with_float_type_variables.json | 5 + ...ut_object_with_fragment_and_variables.json | 14 + ...t_with_inline_fragment_with_variables.json | 10 + .../input_object_with_invalid_arguments1.json | 12 + .../input_object_with_invalid_arguments2.json | 24 + ...t_object_with_invalid_type_variables1.json | 8 + ...t_object_with_invalid_type_variables2.json | 12 + .../input_object_with_missing_arguments.json | 8 + ..._with_missing_nullable_variable_value.json | 8 + ...ject_with_missing_variables_arguments.json | 8 + ...ct_with_nested_input_object_variables.json | 10 + .../input_object_with_nested_object.json | 16 + .../input_object_with_undefined_fields.json | 12 + ...bject_with_unexpected_variable_values.json | 8 + .../input_object_with_variables.json | 7 + .../input_object_without_optional_fields.json | 10 + ...eter_type_not_present_in_return_types.json | 5 + .../input_with_escape_characters.json | 5 + .../input_with_intersection_parameter.json | 5 + ...put_with_intersection_parameter_array.json | 5 + ...with_intersection_parameter_reference.json | 5 + ...ntersection_parameter_reference_array.json | 5 + ...ction_referring_non_intersection_type.json | 5 + ...tion_type_referring_intersection_type.json | 5 + ...rring_intersection_type_as_a_variable.json | 5 + .../input_with_unicode_characters.json | 5 + .../expected_results/interface_field.json | 5 + .../interface_introspection.json | 40 + .../expected_results/interfaces.json | 8 + ..._implementing_interface_introsepction.json | 0 .../interfaces_with_interface_type_array.json | 20 + .../interfaces_with_invalid_field.json | 8 + .../interfaces_with_nested_fragments.json | 8 + ...terfaces_with_type_name_introspection.json | 8 + ...nput_object_having_defaultable_fields.json | 0 ...pection_on_inputs_with_default_values.json | 0 ...pection_on_service_with_input_objects.json | 138 + ...spection_query_with_missing_selection.json | 8 + .../invalid_block_strings.json | 8 + ...num_type_default_value_with_variables.json | 8 + .../invalid_hierarchical_resource_paths.json | 8 + .../invalid_introspection_query.json | 8 + .../invalid_list_type_for_input_objects.json | 8 + ...nvalid_list_type_within_input_objects.json | 12 + ...e_within_input_objects_with_variables.json | 12 + .../expected_results/invalid_mutation.json | 8 + ...id_query_from_service_object_resource.json | 8 + ...id_query_with_distinct_service_unions.json | 8 + .../invalid_schema_introspection_field.json | 8 + .../invalid_spread_inline_fragments.json | 12 + ...lue_with_nested_list_in_input_objects.json | 8 + .../invalid_variables_inside_list_value.json | 12 + .../expected_results/list_type_input.json | 5 + .../list_type_input_with_empty_value.json | 5 + ...ist_type_input_with_invalid_variables.json | 12 + .../list_type_input_with_null_value.json | 5 + .../list_type_input_with_variable.json | 5 + .../list_type_inputs_with_nested_list.json | 5 + ...list_type_variables_inside_list_value.json | 5 + ...ist_type_variables_with_input_objects.json | 5 + ..._variables_with_invalid_input_objects.json | 8 + ...h_invalid_nested_list_in_input_object.json | 12 + ...bles_with_nested_list_in_input_object.json | 9 + .../list_type_with_default_value.json | 5 + .../list_type_with_enum_values.json | 5 + .../list_type_with_input_objects.json | 5 + .../list_type_with_invalid_enum_values.json | 12 + ...type_with_invalid_input_objects_value.json | 8 + ...h_invalid_nested_list_in_input_object.json | 12 + ...ith_invalid_variable_default_values_1.json | 12 + ...ith_invalid_variable_default_values_2.json | 28 + ...ith_invalid_variable_default_values_3.json | 12 + ...ith_invalid_variable_default_values_4.json | 20 + ...ith_invalid_variable_default_values_5.json | 16 + ...ith_invalid_variable_default_values_6.json | 8 + ...ith_invalid_variable_default_values_7.json | 12 + ...ith_invalid_variable_default_values_8.json | 8 + ...ith_invalid_variable_default_values_9.json | 8 + ...type_with_nested_list_in_input_object.json | 9 + ...t_type_with_variable_default_values_1.json | 5 + ...t_type_with_variable_default_values_2.json | 5 + ...t_type_with_variable_default_values_3.json | 5 + ...t_type_with_variable_default_values_4.json | 5 + ...t_type_with_variable_default_values_5.json | 8 + ...t_type_with_variable_default_values_6.json | 8 + ...t_type_with_variable_default_values_7.json | 9 + ...t_type_with_variable_default_values_8.json | 7 + ...t_type_with_variable_default_values_9.json | 5 + .../list_type_within_input_objects.json | 5 + ...e_within_input_objects_with_variables.json | 7 + .../tests/resources/expected_results/map.json | 9 + .../map_with_invalid_key.json | 15 + .../expected_results/map_with_valid_key.json | 7 + .../map_without_key_input.json | 8 + .../multiple_directive_usage_in_fields.json | 9 + .../expected_results/multiple_mutations.json | 16 + ...multiple_mutations_on_service_objects.json | 12 + ...iple_variable_types_with_single_query.json | 9 + .../resources/expected_results/mutation.json | 7 + ...utation_request_on_non_mutable_schema.json | 8 + .../mutation_type_introspection.json | 15 + ...named_fragments_with_duplicate_fields.json | 32 + .../expected_results/nested_fragments.json | 21 + ..._service_objects_with_multiple_fields.json | 8 + ...sted_list_input_with_invalid_values_1.json | 16 + ...sted_list_input_with_invalid_values_2.json | 24 + .../expected_results/nested_map.json | 11 + .../nested_map_without_key_input.json | 12 + .../nested_records_array.json | 64 + .../non_null_input_for_nullable_list.json | 5 + .../non_null_input_for_nullable_record.json | 5 + ..._null_input_for_nullable_record_field.json | 5 + ...type_variable_with_empty_list_value_1.json | 15 + ...type_variable_with_empty_list_value_2.json | 15 + ..._type_variables_with_nullable_rgument.json | 5 + .../expected_results/null_as_enum_input.json | 5 + ...ull_as_enum_input_with_variable_value.json | 5 + .../null_as_resource_function_name.json | 5 + .../null_as_scalar_input.json | 7 + ...l_as_scalar_input_with_variable_value.json | 7 + .../null_input_for_nullable_record_field.json | 5 + .../null_value_for_defaultable_arguments.json | 7 + ...r_defaultable_arguments_with_variable.json | 7 + .../null_value_for_non_null_argument.json | 8 + ...non_null_argument_with_variable_value.json | 8 + ...ut_object_with_error_added_to_context.json | 12 + ...able_input_object_with_variable_value.json | 7 + ...llable_list_type_input_with_variables.json | 5 + .../null_value_in_input_object_field.json | 7 + ...nput_object_field_with_variable_value.json | 7 + ...lue_in_list_type_input_with_variables.json | 5 + .../nullable_input_for_nullable_list.json | 5 + .../nullable_input_for_nullable_record.json | 5 + ...le_list_type_input_with_invalid_value.json | 16 + ...ullable_list_type_input_without_value.json | 5 + ...ervices_array_query_on_selected_types.json | 5 + .../nullable_variables_without_value.json | 5 + .../optional_arrays_with_invalid_query.json | 8 + .../optional_enum_argument_with_value.json | 5 + .../optional_enum_argument_without_value.json | 5 + .../output_with_intersection_paramenter.json | 8 + ...ith_intersection_paramenter_reference.json | 8 + ...put_with_intersection_parameter_array.json | 8 + ...ntersection_parameter_reference_array.json | 8 + .../query_type_introspection.json | 17 + .../query_with_default_parameter.json | 5 + .../query_without_default_parameter.json | 5 + .../querying_subfields_on_type_name.json | 8 + .../querying_table_without_selections.json | 8 + .../expected_results/record_type_arrays.json | 24 + .../request_invalid_field.json | 8 + ...st_invalid_field_from_service_objects.json | 8 + .../requesting_object_without_fields.json | 8 + ...urning_list_of_nested_service_objects.json | 24 + ...lver_returning_map_of_service_objects.json | 9 + ...rning_table_of_nested_service_objects.json | 36 + .../resolver_returning_tables.json | 5 + ...resolver_returning_tables_with_errors.json | 12 + ...ource_returning_arrays_missing_fields.json | 8 + ...urning_optional_service_object_arrays.json | 5 + .../resource_returning_service_object.json | 7 + ...source_returning_service_object_array.json | 5 + .../resource_returning_tables.json | 9 + .../returning_enum_array.json | 5 + .../returning_enum_array_with_errors.json | 10 + ...rning_nullable_enum_array_with_errors.json | 12 + .../returning_recursive_service_type.json | 7 + .../returning_union_of_service_objects.json | 9 + .../same_field_with_multiple_alias.json | 16 + ...th_multiple_alias_different_subfields.json | 16 + .../expected_results/scalar_arrays.json | 5 + .../scalar_arrays_with_errors.json | 10 + .../scalar_nullable_arrays_with_errors.json | 12 + ...t_array_with_fragment_returning_error.json | 16 + ...ect_array_with_invalid_response_order.json | 16 + ...ervice_object_defined_as_record_field.json | 10 + .../service_with_other_annotations.json | 5 + .../test_quering_on_interface.json | 8 + ...ying_fragment_on_transitive_interface.json | 22 + .../test_querying_on_transitive_type.json | 7 + ...ying_on_transitive_type_and_interface.json | 9 + .../expected_results/type_introspection.json | 8 + .../type_introspection_in_invalid_place.json | 8 + ...pe_introspection_on_non_existing_type.json | 5 + .../type_introspection_with_alias.json | 8 + .../type_introspection_without_fields.json | 8 + ...rospection_without_type_name_argument.json | 8 + .../type_name_introspection_in_fragments.json | 8 + ...on_on_nullable_union_of_service_types.json | 9 + .../type_name_introspection_on_operation.json | 5 + ...pe_name_introspection_on_record_types.json | 7 + ...e_name_introspection_on_service_types.json | 8 + ...trospection_on_union_of_service_types.json | 8 + .../typename_introspection_on_field.json | 12 + .../typename_introspection_on_scalar.json | 8 + ...introspection_on_schema_introspection.json | 25 + ...typename_introspection_on_type_record.json | 7 + .../union_of_distinct_service_objects.json | 8 + ...ervices_array_query_on_selected_types.json | 5 + ...ry_on_selected_types_fragment_on_root.json | 5 + ...inct_services_query_on_selected_types.json | 5 + .../expected_results/union_type_names.json | 120 + ...union_types_with_field_returning_enum.json | 8 + ..._object_includes_field_returning_enum.json | 11 + .../unknown_inline_fragment.json | 8 + ..._value_with_coerce_int_input_to_float.json | 5 + .../variables_inside_list_value.json | 9 + ...iables_with_coerce_int_input_to_float.json | 5 + .../variables_with_default_null_value.json | 5 + .../variables_with_default_values.json | 9 + .../variables_with_multiple_operations.json | 8 + .../variables_with_nested_map.json | 11 + .../variables_with_query_and_mutation.json | 8 + .../tests/services.bal | 1446 ++++++++ .../tests/values.bal | 92 +- .../entities.bal | 22 +- .../graphql-subgraph-test-suite/records.bal | 21 + .../subgraphs.bal | 6 + .../tests/01_subgraph_tests.bal} | 41 +- .../tests/listeners.bal | 19 + .../introspection_on_subgraph.graphql | 0 ...uerying_entities_field_on_subgraph.graphql | 0 ...ield_with_list_of_non_any_argument.graphql | 0 ...ies_field_with_list_of_null_values.graphql | 0 ..._entities_field_with_null_argument.graphql | 0 ...ntities_field_with_object_argument.graphql | 0 ...field_without_typename_in_argument.graphql | 0 .../querying_subgraph_with_variable.graphql | 0 ...eturning_record_with_object_fields.graphql | 0 .../introspection_on_subgraph.json | 84 + .../quering_sdl_on_subgraph.json | 7 + .../querying_entities_field_on_subgraph.json | 0 ...s_field_with_list_of_non_any_argument.json | 0 ...s_field_with_list_of_non_any_variable.json | 0 ...tities_field_with_list_of_null_values.json | 0 ...ties_field_with_list_of_null_variable.json | 0 ...ing_entities_field_with_null_argument.json | 0 ...ing_entities_field_with_null_variable.json | 0 ...g_entities_field_with_object_argument.json | 0 ...g_entities_field_with_object_variable.json | 0 ...ities_field_with_variable_on_subgraph.json | 0 ...es_field_without_typename_in_argument.json | 0 ...es_field_without_typename_in_variable.json | 0 ...eturnig_error_for_unresolvable_entity.json | 0 ...turning_error_for_invalid_return_type.json | 0 ..._returning_error_for_invalid_typename.json | 0 ...ntities_resolver_returning_null_value.json | 1 + ...r_returning_record_with_object_fields.json | 7 + .../graphql-subgraph-test-suite/values.bal | 27 + .../tests/01_subscription_tests.bal | 616 ++++ .../tests/02_subscription_with_context.bal | 65 + .../tests/03_subscription_with_constraint.bal | 53 + .../tests/listeners.bal | 26 + .../tests/object_types.bal | 161 + .../tests/records.bal | 78 + .../resources/documents/constraints.graphql | 12 + .../subscriptions_with_fragments.graphql | 14 + ...criptions_with_multiple_operations.graphql | 11 + .../subscriptions_with_records.graphql | 6 + ...subscriptions_with_service_objects.graphql | 6 + .../subscriptions_with_union_type.graphql | 16 +- ...subscriptions_with_variable_values.graphql | 3 + .../constraints_with_subscription.json | 12 + .../expected_results/errors_in_streams.json | 15 + .../subscription_invalid_field.json | 8 + .../tests/services.bal | 156 + .../tests/values.bal | 27 + .../graphql-test-common/Package.md | 3 + .../graphql-test-common/constants.bal | 29 + .../{tests => graphql-test-common}/utils.bal | 84 +- .../tests/02_request_validation.bal | 233 -- ballerina-tests/tests/36_subscriptions.bal | 494 --- .../tests/42_constraint_validation.bal | 98 - ballerina-tests/tests/44_server_caches.bal | 302 -- ballerina-tests/tests/45_query_complexity.bal | 85 - ballerina-tests/tests/README.md | 12 - .../tests/resources/documents/alias.graphql | 10 - .../documents/alias_on_error_path.graphql | 7 - .../alias_on_hierarchical_resources.graphql | 7 - .../alias_on_service_objects_union.graphql | 13 - .../alias_with_invalid_field_name.graphql | 8 - ...arrays_with_errors_in_record_field.graphql | 8 - ...h_mutation_to_http2_based_listener.graphql | 5 - ...with_query_to_http1_based_listener.graphql | 5 - ...with_query_to_http2_based_listener.graphql | 5 - ...h_mutation_to_http1_based_listener.graphql | 5 - ...ballerina_record_as_graphql_object.graphql | 8 - .../resources/documents/block_strings.graphql | 9 - .../block_strings_with_double_quotes.graphql | 8 - .../coerce_int_input_to_float.graphql | 3 - .../documents/coerce_int_to_decimal.graphql | 3 - .../complex_introspection_query.graphql | 8 - ...rospection_query_with_other_fields.graphql | 11 - .../documents/complex_service.graphql | 8 - .../complexity_with_mutation.graphql | 13 - .../complexity_with_union_types.graphql | 24 - .../resources/documents/constraints.graphql | 47 - .../decimal_type_default_value.graphql | 3 - .../documents/decimal_type_input.graphql | 3 - .../documents/decimal_type_list_input.graphql | 3 - ...cimal_type_list_with_default_input.graphql | 3 - .../decimal_type_variable_input.graphql | 3 - .../decimal_type_with_input_object.graphql | 3 - ...pe_with_input_object_default_value.graphql | 3 - .../resources/documents/decimal_types.graphql | 11 - .../decimal_with_marginal_value.graphql | 3 - .../decimal_with_negative_infinity.graphql | 3 - .../decimal_with_positive_infinity.graphql | 3 - ...ault_values_in_input_object_fields.graphql | 3 - .../deprecated_fields_filtering.graphql | 38 - ...ed_fields_filtering_with_variables.graphql | 38 - .../deprecated_fields_introspection.graphql | 48 - ...ields_introspection_with_variables.graphql | 38 - .../documents/directive_locations.graphql | 7 - .../resources/documents/directives.graphql | 14 - .../directives_skip_all_selections.graphql | 5 - .../directives_with_duplicate_fields.graphql | 16 - ...th_service_returning_objects_array.graphql | 7 - ...tives_with_variables_and_fragments.graphql | 18 - .../resources/documents/documentation.graphql | 48 - .../duplicate_fields_with_arguments.graphql | 105 - ...duplicate_fields_with_record_types.graphql | 22 - .../duplicate_inline_fragments.graphql | 25 - .../documents/duplicate_interceptors.graphql | 3 - ...variables_with_multiple_operations.graphql | 19 - .../documents/empty_block_string.graphql | 3 - ...pty_list_type_within_input_objects.graphql | 6 - ...ithin_input_objects_with_variables.graphql | 6 - .../resources/documents/empty_string.graphql | 3 - .../tests/resources/documents/enum.graphql | 5 - .../documents/enum_input_parameter.graphql | 3 - .../enum_input_parameter_as_string.graphql | 3 - .../documents/enum_inside_record.graphql | 3 - .../documents/enum_introspection.graphql | 10 - .../enum_invalid_input_parameter.graphql | 3 - .../enum_value_introspection.graphql | 7 - .../documents/enum_with_union.graphql | 3 - .../enum_with_values_assigned.graphql | 3 - ...te_same_interceptor_multiple_times.graphql | 3 - .../field_object_parameter_order.graphql | 12 - .../documents/float_as_input.graphql | 3 - .../float_with_negative_infinity.graphql | 3 - .../float_with_positive_infinity.graphql | 3 - .../fragment_with_invalid_field.graphql | 9 - .../fragments_on_record_objects.graphql | 9 - .../fragments_with_input_variables.graphql | 15 - ..._with_multiple_resource_invocation.graphql | 23 - .../functions_with_input_parameter.graphql | 3 - ...hql_playground_introspection_query.graphql | 99 - ..._paths_same_type_in_multiple_paths.graphql | 9 - .../hierarchical_resource_paths.graphql | 7 - ...erarchical_resource_paths_complete.graphql | 9 - ...hical_resource_paths_introspection.graphql | 10 - ...es_with_hierarchical_resource_path.graphql | 9 - ...ical_resource_paths_with_fragments.graphql | 16 - ...esource_paths_with_multiple_fields.graphql | 8 - ..._paths_with_same_field_repeating_1.graphql | 9 - ..._paths_with_same_field_repeating_2.graphql | 5 - .../id_input_type_validation_decimal.graphql | 3 - ...nput_type_validation_decimal_array.graphql | 7 - ...put_type_validation_decimal_or_nil.graphql | 3 - .../id_input_type_validation_float.graphql | 3 - ..._input_type_validation_float_array.graphql | 7 - ...input_type_validation_float_array1.graphql | 7 - ...input_type_validation_float_or_nil.graphql | 3 - .../id_input_type_validation_int.graphql | 3 - .../id_input_type_validation_int1.graphql | 7 - ...id_input_type_validation_int_array.graphql | 7 - ...d_input_type_validation_int_or_nil.graphql | 3 - ...nput_type_validation_return_record.graphql | 7 - ...ype_validation_return_record_array.graphql | 7 - .../id_input_type_validation_string.graphql | 3 - ...input_type_validation_string_array.graphql | 7 - ...nput_type_validation_string_or_nil.graphql | 3 - .../id_input_type_validation_uuid.graphql | 7 - ...d_input_type_validation_uuid_array.graphql | 7 - ..._type_validation_uuid_array_or_nil.graphql | 7 - .../documents/id_introspection_query.graphql | 41 - .../documents/inline_fragment.graphql | 17 - ...inline_fragments_on_record_objects.graphql | 12 - .../inline_fragments_with_variables.graphql | 14 - ...nested_fragments_on_record_objects.graphql | 22 - .../resources/documents/input_object.graphql | 5 - ...lude_fields_with_complex_variables.graphql | 5 - ...de_fields_with_undefined_variables.graphql | 5 - ...ject_include_fields_with_variables.graphql | 5 - ...t_type_variables_inside_list_value.graphql | 5 - .../input_object_with_default_value.graphql | 5 - ...input_object_with_duplicate_fields.graphql | 5 - ...object_with_fragment_and_variables.graphql | 15 - ...ith_inline_fragment_with_variables.graphql | 9 - ...put_object_with_invalid_arguments1.graphql | 5 - ...put_object_with_invalid_arguments2.graphql | 5 - ...bject_with_invalid_type_variables2.graphql | 5 - ...nput_object_with_missing_arguments.graphql | 5 - ...th_missing_nullable_variable_value.graphql | 5 - ...t_with_missing_variables_arguments.graphql | 5 - .../input_object_with_nested_object.graphql | 6 - ...input_object_with_undefined_fields.graphql | 5 - ...ct_with_unexpected_variable_values.graphql | 9 - ...put_object_without_optional_fields.graphql | 5 - ...r_type_not_present_in_return_types.graphql | 3 - .../input_with_escape_characters.graphql | 3 - .../input_with_unicode_characters.graphql | 3 - .../interceptor_execution_order.graphql | 4 - .../resources/documents/interceptors.graphql | 3 - .../interceptors_returning_error1.graphql | 3 - .../interceptors_returning_error2.graphql | 3 - .../interceptors_returning_error3.graphql | 6 - ...errors_with_hierarchical_resources.graphql | 9 - .../interceptors_with_arrays.graphql | 3 - ...ors_with_destructive_modification1.graphql | 11 - ...ors_with_destructive_modification2.graphql | 10 - .../documents/interceptors_with_enum.graphql | 3 - .../interceptors_with_fragments.graphql | 11 - ...rs_with_fragments_and_subscription.graphql | 29 - ...terceptors_with_hierarchical_paths.graphql | 6 - ..._invalid_destructive_modification1.graphql | 3 - ..._invalid_destructive_modification2.graphql | 3 - ..._invalid_destructive_modification3.graphql | 8 - ..._invalid_destructive_modification4.graphql | 6 - .../documents/interceptors_with_map.graphql | 14 - .../interceptors_with_mutation.graphql | 9 - .../interceptors_with_null_value2.graphql | 4 - .../interceptors_with_record_fields.graphql | 15 - .../interceptors_with_records.graphql | 13 - ...ceptors_with_records_and_fragments.graphql | 18 - .../interceptors_with_service_object.graphql | 11 - ...s_with_subscription_return_records.graphql | 13 - ...ith_subscription_return_union_type.graphql | 22 - .../documents/interceptors_with_table.graphql | 8 - .../documents/interceptors_with_union.graphql | 15 - .../documents/interface_field.graphql | 5 - .../documents/interface_introspection.graphql | 12 - .../resources/documents/interfaces.graphql | 16 - ...terfaces_with_interface_type_array.graphql | 13 - .../interfaces_with_invalid_field.graphql | 20 - ...faces_with_type_name_introspection.graphql | 20 - ...introspection_for_person_and_greet.graphql | 99 - ...tion_on_service_with_input_objects.graphql | 13 - ...ction_query_with_missing_selection.graphql | 3 - .../invalid_complexity_query.graphql | 25 - ...nvalid_hierarchical_resource_paths.graphql | 8 - .../invalid_introspection_query.graphql | 5 - ...nvalid_list_type_for_input_objects.graphql | 6 - ...lid_list_type_within_input_objects.graphql | 6 - ...ithin_input_objects_with_variables.graphql | 6 - ...query_from_service_object_resource.graphql | 7 - ...query_with_distinct_service_unions.graphql | 5 - ...invalid_schema_introspection_field.graphql | 10 - .../invalid_spread_inline_fragments.graphql | 12 - ..._with_nested_list_in_input_objects.graphql | 6 - ...nvalid_variables_inside_list_value.graphql | 6 - .../documents/list_type_input.graphql | 3 - .../list_type_input_with_empty_value.graphql | 3 - .../list_type_input_with_null_value.graphql | 3 - .../list_type_input_with_variable.graphql | 3 - .../list_type_inputs_with_nested_list.graphql | 3 - ...t_type_variables_inside_list_value.graphql | 3 - ..._type_variables_with_input_objects.graphql | 5 - ...riables_with_invalid_input_objects.graphql | 5 - ...nvalid_nested_list_in_input_object.graphql | 5 - ...s_with_nested_list_in_input_object.graphql | 5 - .../list_type_with_default_value.graphql | 3 - .../list_type_with_enum_values.graphql | 3 - .../list_type_with_input_objects.graphql | 5 - ...list_type_with_invalid_enum_values.graphql | 3 - ...e_with_invalid_input_objects_value.graphql | 5 - ...nvalid_nested_list_in_input_object.graphql | 5 - ..._invalid_variable_default_values_4.graphql | 3 - ..._invalid_variable_default_values_7.graphql | 6 - ..._invalid_variable_default_values_8.graphql | 3 - ..._invalid_variable_default_values_9.graphql | 3 - ...e_with_nested_list_in_input_object.graphql | 5 - ...ype_with_variable_default_values_5.graphql | 6 - ...ype_with_variable_default_values_6.graphql | 6 - ...ype_with_variable_default_values_7.graphql | 6 - ...ype_with_variable_default_values_8.graphql | 6 - .../list_type_within_input_objects.graphql | 6 - ...ithin_input_objects_with_variables.graphql | 6 - .../tests/resources/documents/map.graphql | 7 - .../documents/map_with_invalid_key.graphql | 8 - .../documents/map_with_valid_key.graphql | 5 - .../documents/map_without_key_input.graphql | 7 - ...multiple_directive_usage_in_fields.graphql | 10 - .../documents/multiple_mutations.graphql | 14 - ...tiple_mutations_on_service_objects.graphql | 10 - ..._without_operation_name_in_request.graphql | 11 - ...e_variable_types_with_single_query.graphql | 7 - .../resources/documents/mutation.graphql | 5 - ...tion_request_on_non_mutable_schema.graphql | 5 - .../mutation_type_introspection.graphql | 10 - ...ed_fragments_with_duplicate_fields.graphql | 37 - ...d_list_input_with_invalid_values_1.graphql | 3 - ...d_list_input_with_invalid_values_2.graphql | 3 - .../resources/documents/nested_map.graphql | 9 - .../nested_map_without_key_input.graphql | 7 - .../documents/nested_records_array.graphql | 11 - .../non_null_input_for_nullable_list.graphql | 8 - ...non_null_input_for_nullable_record.graphql | 9 - ...ll_input_for_nullable_record_field.graphql | 5 - ...e_variable_with_empty_list_value_1.graphql | 6 - ...e_variable_with_empty_list_value_2.graphql | 6 - .../documents/null_as_enum_input.graphql | 3 - .../null_as_resource_function_name.graphql | 3 - .../documents/null_as_scalar_input.graphql | 5 - ...ll_input_for_nullable_record_field.graphql | 5 - ...ll_value_for_defaultable_arguments.graphql | 5 - ...efaultable_arguments_with_variable.graphql | 5 - .../null_value_for_non_null_argument.graphql | 3 - ...object_with_error_added_to_context.graphql | 3 - .../null_value_in_input_object_field.graphql | 5 - .../nullable_input_for_nullable_list.graphql | 3 - ...nullable_input_for_nullable_record.graphql | 3 - ...list_type_input_with_invalid_value.graphql | 3 - ...able_list_type_input_without_value.graphql | 3 - ...ices_array_query_on_selected_types.graphql | 7 - ...optional_arrays_with_invalid_query.graphql | 3 - .../optional_enum_argument_with_value.graphql | 3 - ...tional_enum_argument_without_value.graphql | 3 - .../query_type_introspection.graphql | 10 - .../documents/query_union_type.graphql | 14 - .../query_with_default_parameter.graphql | 3 - .../query_without_default_parameter.graphql | 3 - .../querying_subfields_on_type_name.graphql | 7 - .../querying_table_without_selections.graphql | 3 - .../documents/record_type_arrays.graphql | 8 - .../documents/request_invalid_field.graphql | 5 - ...invalid_field_from_service_objects.graphql | 11 - .../requesting_object_without_fields.graphql | 3 - ...ing_list_of_nested_service_objects.graphql | 8 - ...r_returning_map_of_service_objects.graphql | 7 - ...ng_table_of_nested_service_objects.graphql | 8 - ...olver_returning_tables_with_errors.graphql | 5 - .../documents/resource_interceptors.graphql | 14 - ...ce_returning_arrays_missing_fields.graphql | 3 - ...ing_optional_service_object_arrays.graphql | 7 - .../resource_returning_service_object.graphql | 5 - ...rce_returning_service_object_array.graphql | 5 - .../resource_returning_tables.graphql | 5 - .../documents/returning_enum_array.graphql | 3 - .../returning_enum_array_with_errors.graphql | 3 - ...ng_nullable_enum_array_with_errors.graphql | 3 - .../returning_recursive_service_type.graphql | 5 - ...returning_union_of_service_objects.graphql | 14 - .../same_field_with_multiple_alias.graphql | 14 - ...multiple_alias_different_subfields.graphql | 14 - .../resources/documents/scalar_arrays.graphql | 3 - .../scalar_arrays_with_errors.graphql | 3 - ...scalar_nullable_arrays_with_errors.graphql | 3 - .../resources/documents/server_cache.graphql | 8 - .../documents/server_cache_eviction.graphql | 12 - .../server_cache_eviction_with_arrays.graphql | 13 - ...r_cache_eviction_with_interceptors.graphql | 7 - ...er_cache_eviction_with_list_inputs.graphql | 10 - ...ache_eviction_with_nullable_inputs.graphql | 13 - ...er_cache_eviction_with_service_obj.graphql | 13 - .../server_cache_eviction_with_union.graphql | 15 - ...rver_cache_input_object_parameters.graphql | 18 - .../server_cache_list_inputs.graphql | 8 - .../server_cache_operations_with_TTL.graphql | 8 - .../server_cache_with_arrays.graphql | 13 - ...erver_cache_with_dynamic_responses.graphql | 44 - .../server_cache_with_errors.graphql | 7 - .../server_cache_with_errors_2.graphql | 13 - .../server_cache_with_input_object.graphql | 12 - .../server_cache_with_inputs.graphql | 21 - .../server_cache_with_interceptors.graphql | 7 - .../server_cache_with_list_input.graphql | 63 - .../server_cache_with_list_inputs.graphql | 10 - .../server_cache_with_null_values.graphql | 12 - .../server_cache_with_nullable_inputs.graphql | 13 - ...erver_cache_with_partial_responses.graphql | 17 - .../server_cache_with_records.graphql | 13 - ...server_cache_with_records_eviction.graphql | 13 - ...rver_cache_with_records_operations.graphql | 13 - .../server_cache_with_service_obj.graphql | 13 - .../documents/server_cache_with_union.graphql | 15 - ...ache_with_unions_operational_level.graphql | 32 - ...rray_with_fragment_returning_error.graphql | 10 - ..._array_with_invalid_response_order.graphql | 10 - ...ice_object_defined_as_record_field.graphql | 8 - .../service_with_other_annotations.graphql | 3 - .../subscriptions_with_fragments.graphql | 14 - ...criptions_with_multiple_operations.graphql | 11 - .../subscriptions_with_records.graphql | 6 - ...subscriptions_with_service_objects.graphql | 6 - ...subscriptions_with_variable_values.graphql | 3 - .../documents/type_introspection.graphql | 8 - ...ype_introspection_in_invalid_place.graphql | 7 - ...introspection_on_non_existing_type.graphql | 5 - .../type_introspection_with_alias.graphql | 6 - .../type_introspection_without_fields.graphql | 3 - ...pection_without_type_name_argument.graphql | 8 - ...on_nullable_union_of_service_types.graphql | 15 - ...name_introspection_on_record_types.graphql | 5 - ...ame_introspection_on_service_types.graphql | 6 - ...spection_on_union_of_service_types.graphql | 15 - .../typename_introspection_on_field.graphql | 9 - .../typename_introspection_on_scalar.graphql | 7 - .../union_of_distinct_service_objects.graphql | 11 - ...ices_array_query_on_selected_types.graphql | 7 - ...on_selected_types_fragment_on_root.graphql | 9 - ...t_services_query_on_selected_types.graphql | 7 - .../union_type_as_record_field.graphql | 16 - ...e_as_record_field_without_fragment.graphql | 7 - .../documents/union_type_names.graphql | 25 - ...union_type_with_field_and_fragment.graphql | 10 - ...union_type_with_fragment_and_field.graphql | 10 - ...union_type_with_incorrect_fragment.graphql | 14 - ...on_types_with_field_returning_enum.graphql | 8 - ...pes_with_missing_types_in_document.graphql | 9 - ...ject_includes_field_returning_enum.graphql | 11 - .../documents/unknown_fragment.graphql | 3 - .../documents/unknown_inline_fragment.graphql | 5 - .../unknown_nested_fragments.graphql | 16 - .../documents/unused_fragment.graphql | 11 - .../documents/valid_complexity_query.graphql | 9 - .../variables_inside_list_value.graphql | 5 - .../variables_with_default_values.graphql | 15 - ...variables_with_multiple_operations.graphql | 13 - .../variables_with_nested_map.graphql | 9 - .../variables_with_query_and_mutation.graphql | 10 - .../resources/expected_results/alias.json | 12 - .../expected_results/alias_on_error_path.json | 15 - .../alias_on_hierarchical_resources.json | 9 - .../alias_on_service_objects_union.json | 10 - .../alias_with_invalid_field_name.json | 13 - .../arrays_with_errors_in_record_field.json | 27 - ...with_mutation_to_http2_based_listener.json | 7 - ...ce_with_query_to_http1_based_listener.json | 7 - ...ce_with_query_to_http2_based_listener.json | 7 - ...with_mutation_to_http1_based_listener.json | 7 - .../ballerina_record_as_graphql_object.json | 10 - .../expected_results/block_strings.json | 5 - .../block_strings_with_double_quotes.json | 5 - .../block_strings_with_escaped_character.json | 5 - ...k_strings_with_variable_default_value.json | 5 - .../coerce_decimal_to_float.json | 5 - .../coerce_int_input_to_float.json | 5 - .../coerce_int_to_decimal.json | 5 - ...rce_int_to_decimal_with_default_value.json | 5 - .../complex_introspection_query.json | 76 - ...introspection_query_with_other_fields.json | 87 - .../expected_results/complex_service.json | 10 - .../complexity_with_mutation.json | 13 - .../complexity_with_union_types.json | 13 - .../expected_results/constraints.json | 17 - .../constraints_configuration.json | 5 - .../constraints_with_intersection_types.json | 17 - .../constraints_with_list_type_inputs.json | 17 - .../constraints_with_mutation.json | 17 - .../constraints_with_subscription.json | 14 - .../constraints_with_variables_1.json | 17 - .../constraints_with_variables_2.json | 17 - ...r_with_different_alias_for_same_field.json | 69 - .../dataloader_with_interceptor.json | 24 - .../dataloader_with_mutation.json | 34 - .../dataloader_with_query.json | 49 - .../decimal_type_default_value.json | 5 - .../expected_results/decimal_type_input.json | 5 - .../decimal_type_list_input.json | 5 - .../decimal_type_list_with_default_input.json | 5 - ...decimal_type_list_with_variable_input.json | 5 - .../decimal_type_variable_input.json | 5 - .../decimal_type_with_input_object.json | 5 - ..._type_with_input_object_default_value.json | 5 - ...cimal_type_with_input_object_variable.json | 5 - .../decimal_with_marginal_value.json | 5 - .../decimal_with_negative_infinity.json | 13 - .../decimal_with_negative_zero.json | 5 - .../decimal_with_positive_infinity.json | 13 - ...default_values_in_input_object_fields.json | 5 - .../deprecated_fields_filtering.json | 125 - ...cated_fields_filtering_with_variables.json | 125 - .../deprecated_fields_introspection.json | 248 -- ...d_fields_introspection_with_variables.json | 211 -- .../expected_results/directive_locations.json | 28 - .../expected_results/directives.json | 9 - .../directives_skip_all_selections.json | 3 - .../directives_with_duplicate_fields.json | 10 - ..._with_service_returning_objects_array.json | 9 - ...rectives_with_variables_and_fragments.json | 10 - .../expected_results/documentation.json | 92 - .../duplicate_fields_with_enum_args_1.json | 17 - .../duplicate_fields_with_enum_args_2.json | 17 - .../duplicate_fields_with_enum_args_3.json | 17 - ...icate_fields_with_input_object_args_1.json | 17 - ...icate_fields_with_input_object_args_2.json | 17 - ...icate_fields_with_input_object_args_3.json | 17 - ...icate_fields_with_input_object_args_4.json | 30 - .../duplicate_fields_with_list_args_1.json | 21 - .../duplicate_fields_with_list_args_2.json | 30 - .../duplicate_fields_with_list_args_3.json | 42 - .../duplicate_fields_with_record_types.json | 14 - .../duplicate_fields_with_scalar_args_1.json | 30 - .../duplicate_fields_with_scalar_args_2.json | 17 - .../duplicate_fields_with_scalar_args_3.json | 17 - .../duplicate_inline_fragments.json | 38 - .../duplicate_input_variables.json | 13 - .../duplicate_interceptors.json | 5 - ...te_variables_with_multiple_operations.json | 9 - .../expected_results/empty_block_string.json | 5 - .../empty_list_type_within_input_objects.json | 30 - ...e_within_input_objects_with_variables.json | 30 - .../expected_results/empty_string.json | 5 - .../resources/expected_results/enum.json | 7 - .../enum_input_parameter.json | 5 - .../enum_input_parameter_as_string.json | 13 - .../expected_results/enum_inside_record.json | 5 - .../expected_results/enum_introspection.json | 230 -- .../enum_invalid_input_parameter.json | 13 - ...num_type_default_value_with_variables.json | 5 - .../expected_results/enum_type_variables.json | 5 - .../enum_value_introspection.json | 13 - .../expected_results/enum_with_union.json | 15 - .../enum_with_values_assigned.json | 5 - ..._with_values_assigned_using_variables.json | 5 - .../expected_results/errors_in_streams.json | 17 - ...ecute_same_interceptor_multiple_times.json | 5 - .../expected_results/field_object.json | 7 - .../field_object_parameter_order1.json | 7 - .../field_object_parameter_order2.json | 8 - .../field_object_with_multiple_args.json | 8 - .../expected_results/float_as_input.json | 5 - ...loat_type_variable_with_default_value.json | 5 - .../fragment_on_invalid_type.json | 13 - .../fragment_with_invalid_field.json | 13 - ...ide_fragments_when_returning_services.json | 7 - .../fragments_on_record_objects.json | 15 - .../fragments_querying_service_objects.json | 9 - .../fragments_with_input_variables.json | 9 - .../fragments_with_introspection.json | 59 - .../fragments_with_invalid_introspection.json | 13 - ...nts_with_multiple_resource_invocation.json | 32 - .../functions_with_input_parameter.json | 5 - ...raphql_playground_introspection_query.json | 1483 -------- ...tion_query_with_complexity_validation.json | 13 - ...cal_paths_same_type_in_multiple_paths.json | 3 - .../hierarchical_resource_paths.json | 9 - .../hierarchical_resource_paths_complete.json | 11 - ...archical_resource_paths_introspection.json | 207 -- ...vices_with_hierarchical_resource_path.json | 11 - ...rchical_resource_paths_with_fragments.json | 10 - ...l_resource_paths_with_multiple_fields.json | 10 - ...rce_paths_with_same_field_repeating_1.json | 11 - ...rce_paths_with_same_field_repeating_2.json | 7 - .../id_input_type_validation_decimal.json | 5 - ...d_input_type_validation_decimal_array.json | 9 - ..._input_type_validation_decimal_or_nil.json | 5 - .../id_input_type_validation_float.json | 5 - .../id_input_type_validation_float_array.json | 9 - ...id_input_type_validation_float_array1.json | 21 - ...id_input_type_validation_float_or_nil.json | 5 - .../id_input_type_validation_int.json | 5 - .../id_input_type_validation_int1.json | 9 - .../id_input_type_validation_int_array.json | 9 - .../id_input_type_validation_int_or_nil.json | 5 - ...d_input_type_validation_return_record.json | 9 - ...t_type_validation_return_record_array.json | 21 - .../id_input_type_validation_string.json | 5 - ...id_input_type_validation_string_array.json | 9 - ...d_input_type_validation_string_or_nil.json | 5 - .../id_input_type_validation_uuid.json | 9 - .../id_input_type_validation_uuid_array.json | 9 - ...put_type_validation_uuid_array_or_nil.json | 9 - .../id_introspection_query.json | 640 ---- .../expected_results/inline_fragment.json | 32 - .../inline_fragments_on_record_objects.json | 10 - .../inline_fragments_with_variables.json | 10 - ...ne_nested_fragments_on_record_objects.json | 16 - .../expected_results/input_object.json | 7 - ...include_fields_with_complex_variables.json | 12 - ...clude_fields_with_undefined_variables.json | 13 - ..._object_include_fields_with_variables.json | 12 - ..._fields_with_variables_missing_values.json | 13 - ...ject_type_variables_inside_list_value.json | 15 - ...ject_variables_with_invalid_type_name.json | 13 - .../input_object_with_default_value.json | 12 - .../input_object_with_duplicate_fields.json | 13 - .../input_object_with_enum_type_argument.json | 5 - ...nput_object_with_float_type_variables.json | 5 - ...ut_object_with_fragment_and_variables.json | 14 - ...t_with_inline_fragment_with_variables.json | 18 - .../input_object_with_invalid_arguments1.json | 22 - .../input_object_with_invalid_arguments2.json | 49 - ...t_object_with_invalid_type_variables1.json | 13 - ...t_object_with_invalid_type_variables2.json | 22 - .../input_object_with_missing_arguments.json | 13 - ..._with_missing_nullable_variable_value.json | 12 - ...ject_with_missing_variables_arguments.json | 13 - ...ct_with_nested_input_object_variables.json | 18 - .../input_object_with_nested_object.json | 22 - .../input_object_with_undefined_fields.json | 22 - ...bject_with_unexpected_variable_values.json | 13 - .../input_object_with_variables.json | 7 - .../input_object_without_optional_fields.json | 18 - ...eter_type_not_present_in_return_types.json | 5 - .../input_with_escape_characters.json | 5 - .../input_with_intersection_parameter.json | 5 - ...put_with_intersection_parameter_array.json | 5 - ...with_intersection_parameter_reference.json | 5 - ...ntersection_parameter_reference_array.json | 5 - ...ction_referring_non_intersection_type.json | 5 - ...tion_type_referring_intersection_type.json | 5 - ...rring_intersection_type_as_a_variable.json | 5 - .../input_with_unicode_characters.json | 5 - .../interceptor_execution_order.json | 6 - .../expected_results/interceptors.json | 5 - .../interceptors_returning_error1.json | 17 - .../interceptors_returning_error2.json | 17 - .../interceptors_returning_error3.json | 17 - ...ng_errors_with_hierarchical_resources.json | 64 - .../interceptors_returning_invalid_value.json | 29 - .../interceptors_with_arrays.json | 10 - ...eptors_with_destructive_modification1.json | 17 - ...eptors_with_destructive_modification2.json | 6 - .../interceptors_with_enum.json | 5 - .../interceptors_with_fragments.json | 9 - .../interceptors_with_hierarchical_paths.json | 8 - ...ith_invalid_destructive_modification1.json | 53 - ...ith_invalid_destructive_modification2.json | 41 - ...ith_invalid_destructive_modification3.json | 54 - ...ith_invalid_destructive_modification4.json | 35 - .../interceptors_with_map.json | 16 - .../interceptors_with_mutation.json | 11 - .../interceptors_with_null_value1.json | 5 - .../interceptors_with_null_value2.json | 6 - .../interceptors_with_record_fields.json | 28 - .../interceptors_with_records.json | 15 - ...terceptors_with_records_and_fragments.json | 28 - .../interceptors_with_service_object.json | 13 - .../interceptors_with_table.json | 26 - .../interceptors_with_union.json | 13 - .../expected_results/interface_field.json | 13 - .../interface_introspection.json | 107 - .../expected_results/interfaces.json | 14 - .../interfaces_with_interface_type_array.json | 32 - .../interfaces_with_invalid_field.json | 13 - .../interfaces_with_nested_fragments.json | 14 - ...terfaces_with_type_name_introspection.json | 16 - .../introspection_for_person_and_greet.json | 973 ------ ...pection_on_service_with_input_objects.json | 189 - .../introspection_on_subgraph.json | 178 - ...spection_query_with_missing_selection.json | 13 - .../invalid_block_strings.json | 13 - .../invalid_complexity_query.json | 13 - ...num_type_default_value_with_variables.json | 13 - .../invalid_hierarchical_resource_paths.json | 14 - .../invalid_introspection_query.json | 13 - .../invalid_list_type_for_input_objects.json | 13 - ...nvalid_list_type_within_input_objects.json | 22 - ...e_within_input_objects_with_variables.json | 22 - .../expected_results/invalid_mutation.json | 13 - ...id_query_from_service_object_resource.json | 13 - ...id_query_with_distinct_service_unions.json | 13 - .../invalid_schema_introspection_field.json | 13 - .../invalid_spread_inline_fragments.json | 22 - ...lue_with_nested_list_in_input_objects.json | 13 - .../invalid_variables_inside_list_value.json | 22 - .../list_type_input copy.json | 5 - .../expected_results/list_type_input.json | 5 - .../list_type_input_with_empty_value.json | 5 - ...ist_type_input_with_invalid_variables.json | 22 - .../list_type_input_with_null_value.json | 5 - .../list_type_input_with_variable.json | 5 - .../list_type_inputs_with_nested_list.json | 5 - ...list_type_variables_inside_list_value.json | 5 - ...ist_type_variables_with_input_objects.json | 9 - ..._variables_with_invalid_input_objects.json | 13 - ...h_invalid_nested_list_in_input_object.json | 22 - ...bles_with_nested_list_in_input_object.json | 15 - .../list_type_with_default_value.json | 5 - .../list_type_with_enum_values.json | 5 - .../list_type_with_input_objects.json | 9 - .../list_type_with_invalid_enum_values.json | 22 - ...type_with_invalid_input_objects_value.json | 13 - ...h_invalid_nested_list_in_input_object.json | 22 - ...ith_invalid_variable_default_values_1.json | 22 - ...ith_invalid_variable_default_values_2.json | 58 - ...ith_invalid_variable_default_values_3.json | 22 - ...ith_invalid_variable_default_values_4.json | 40 - ...ith_invalid_variable_default_values_5.json | 31 - ...ith_invalid_variable_default_values_6.json | 13 - ...ith_invalid_variable_default_values_7.json | 22 - ...ith_invalid_variable_default_values_8.json | 13 - ...ith_invalid_variable_default_values_9.json | 13 - ...type_with_nested_list_in_input_object.json | 15 - ...t_type_with_variable_default_values_1.json | 5 - ...t_type_with_variable_default_values_2.json | 5 - ...t_type_with_variable_default_values_3.json | 5 - ...t_type_with_variable_default_values_4.json | 5 - ...t_type_with_variable_default_values_5.json | 14 - ...t_type_with_variable_default_values_6.json | 14 - ...t_type_with_variable_default_values_7.json | 18 - ...t_type_with_variable_default_values_8.json | 10 - ...t_type_with_variable_default_values_9.json | 5 - .../list_type_within_input_objects.json | 10 - ...e_within_input_objects_with_variables.json | 10 - .../tests/resources/expected_results/map.json | 9 - .../map_with_invalid_key.json | 20 - .../expected_results/map_with_valid_key.json | 7 - .../map_without_key_input.json | 13 - .../multiple_directive_usage_in_fields.json | 9 - .../expected_results/multiple_mutations.json | 16 - ...multiple_mutations_on_service_objects.json | 12 - ...iple_variable_types_with_single_query.json | 15 - .../resources/expected_results/mutation.json | 7 - ...utation_request_on_non_mutable_schema.json | 13 - .../mutation_type_introspection.json | 23 - ...named_fragments_with_duplicate_fields.json | 38 - .../expected_results/nested_fragments.json | 21 - ..._service_objects_with_multiple_fields.json | 8 - ...sted_list_input_with_invalid_values_1.json | 31 - ...sted_list_input_with_invalid_values_2.json | 49 - .../expected_results/nested_map.json | 11 - .../nested_map_without_key_input.json | 22 - .../nested_records_array.json | 98 - .../non_null_input_for_nullable_list.json | 5 - .../non_null_input_for_nullable_record.json | 5 - ..._null_input_for_nullable_record_field.json | 5 - ...type_variable_with_empty_list_value_1.json | 30 - ...type_variable_with_empty_list_value_2.json | 30 - ..._type_variables_with_nullable_rgument.json | 5 - .../expected_results/null_as_enum_input.json | 5 - ...ull_as_enum_input_with_variable_value.json | 5 - .../null_as_resource_function_name.json | 5 - .../null_as_scalar_input.json | 7 - ...l_as_scalar_input_with_variable_value.json | 7 - .../null_input_for_nullable_record_field.json | 5 - .../null_value_for_defaultable_arguments.json | 7 - ...r_defaultable_arguments_with_variable.json | 7 - .../null_value_for_non_null_argument.json | 13 - ...non_null_argument_with_variable_value.json | 13 - ...ut_object_with_error_added_to_context.json | 17 - ...able_input_object_with_variable_value.json | 7 - ...llable_list_type_input_with_variables.json | 5 - .../null_value_in_input_object_field.json | 7 - ...nput_object_field_with_variable_value.json | 7 - ...lue_in_list_type_input_with_variables.json | 5 - .../nullable_input_for_nullable_list.json | 5 - .../nullable_input_for_nullable_record.json | 5 - ...le_list_type_input_with_invalid_value.json | 31 - ...ullable_list_type_input_without_value.json | 5 - ...ervices_array_query_on_selected_types.json | 11 - .../nullable_variables_without_value.json | 5 - .../optional_arrays_with_invalid_query.json | 13 - .../optional_enum_argument_with_value.json | 5 - .../optional_enum_argument_without_value.json | 5 - .../output_with_intersection_paramenter.json | 8 - ...ith_intersection_paramenter_reference.json | 8 - ...put_with_intersection_parameter_array.json | 14 - ...ntersection_parameter_reference_array.json | 14 - .../quering_sdl_on_subgraph.json | 7 - .../query_type_introspection.json | 29 - .../query_with_default_parameter.json | 5 - .../query_without_default_parameter.json | 5 - .../querying_subfields_on_type_name.json | 13 - .../querying_table_without_selections.json | 13 - .../expected_results/record_type_arrays.json | 24 - .../request_invalid_field.json | 13 - ...st_invalid_field_from_service_objects.json | 13 - .../requesting_object_without_fields.json | 13 - ...ver_returnig_error_for_invalid_entity.json | 22 - ...urning_list_of_nested_service_objects.json | 24 - ...lver_returning_map_of_service_objects.json | 9 - ...rning_table_of_nested_service_objects.json | 36 - .../resolver_returning_tables.json | 15 - ...resolver_returning_tables_with_errors.json | 25 - .../resource_interceptors.json | 28 - ...ource_returning_arrays_missing_fields.json | 14 - ...urning_optional_service_object_arrays.json | 15 - .../resource_returning_service_object.json | 7 - ...source_returning_service_object_array.json | 15 - .../resource_returning_tables.json | 15 - .../returning_enum_array.json | 8 - .../returning_enum_array_with_errors.json | 15 - ...rning_nullable_enum_array_with_errors.json | 17 - .../returning_recursive_service_type.json | 7 - .../returning_union_of_service_objects.json | 15 - .../same_field_with_multiple_alias.json | 16 - ...th_multiple_alias_different_subfields.json | 16 - .../expected_results/scalar_arrays.json | 5 - .../scalar_arrays_with_errors.json | 15 - .../scalar_nullable_arrays_with_errors.json | 17 - .../expected_results/server_cache_1.json | 6 - .../expected_results/server_cache_10.json | 5 - .../expected_results/server_cache_2.json | 5 - .../expected_results/server_cache_3.json | 6 - .../expected_results/server_cache_4.json | 6 - .../expected_results/server_cache_5.json | 5 - .../expected_results/server_cache_6.json | 9 - .../expected_results/server_cache_7.json | 9 - .../expected_results/server_cache_8.json | 9 - .../expected_results/server_cache_9.json | 6 - .../server_cache_eviction_with_TTL_1.json | 5 - .../server_cache_eviction_with_TTL_2.json | 5 - .../server_cache_eviction_with_TTL_3.json | 5 - ...ver_cache_eviction_with_list_inputs_1.json | 5 - ...ver_cache_eviction_with_list_inputs_2.json | 8 - ...ver_cache_eviction_with_list_inputs_3.json | 5 - ...cache_eviction_with_nullable_inputs_1.json | 14 - ...cache_eviction_with_nullable_inputs_2.json | 8 - ...cache_eviction_with_nullable_inputs_3.json | 14 - .../server_cache_operation_1.json | 6 - ...he_records_with_non_optional_fields_1.json | 15 - ...he_records_with_non_optional_fields_2.json | 18 - ...he_records_with_non_optional_fields_3.json | 5 - .../server_cache_with_arrays_1.json | 22 - .../server_cache_with_arrays_2.json | 8 - .../server_cache_with_arrays_3.json | 22 - .../server_cache_with_arrays_4.json | 26 - .../server_cache_with_arrays_5.json | 22 - .../server_cache_with_arrays_6.json | 27 - .../server_cache_with_arrays_7.json | 22 - .../server_cache_with_dataloader_1.json | 49 - .../server_cache_with_dataloader_2.json | 34 - .../server_cache_with_dataloader_3.json | 49 - .../server_cache_with_dataloader_4.json | 49 - .../server_cache_with_dataloader_5.json | 34 - ...server_cache_with_dynamic_responses_1.json | 7 - ...server_cache_with_dynamic_responses_2.json | 8 - ...server_cache_with_dynamic_responses_3.json | 9 - ...server_cache_with_dynamic_responses_4.json | 9 - ...server_cache_with_dynamic_responses_5.json | 9 - ...server_cache_with_dynamic_responses_6.json | 8 - ...server_cache_with_dynamic_responses_7.json | 9 - ...server_cache_with_dynamic_responses_8.json | 8 - .../server_cache_with_empty_input_1.json | 5 - .../server_cache_with_empty_input_2.json | 5 - .../server_cache_with_errors_1.json | 17 - .../server_cache_with_errors_2.json | 5 - .../server_cache_with_errors_3.json | 8 - .../server_cache_with_errors_4.json | 15 - .../server_cache_with_errors_5.json | 8 - .../server_cache_with_input_object_1.json | 8 - .../server_cache_with_input_object_2.json | 7 - .../server_cache_with_input_object_3.json | 8 - .../server_cache_with_interceptors_1.json | 5 - .../server_cache_with_interceptors_2.json | 5 - .../server_cache_with_interceptors_3.json | 5 - .../server_cache_with_list_input_1.json | 11 - .../server_cache_with_list_input_2.json | 11 - .../server_cache_with_list_input_3.json | 9 - .../server_cache_with_list_input_4.json | 11 - .../server_cache_with_list_input_5.json | 9 - .../server_cache_with_list_input_6.json | 11 - .../server_cache_with_list_input_7.json | 5 - .../server_cache_with_list_input_8.json | 5 - .../server_cache_with_null_values_1.json | 5 - .../server_cache_with_null_values_2.json | 7 - .../server_cache_with_null_values_3.json | 8 - .../server_cache_with_nullable_inputs_1.json | 18 - .../server_cache_with_nullable_inputs_2.json | 8 - .../server_cache_with_nullable_inputs_3.json | 14 - .../server_cache_with_nullable_inputs_4.json | 8 - .../server_cache_with_nullable_inputs_5.json | 10 - .../server_cache_with_nullable_inputs_6.json | 5 - .../server_cache_with_nullable_inputs_7.json | 5 - .../server_cache_with_nullable_inputs_8.json | 5 - .../server_cache_with_partial_reponses_1.json | 7 - .../server_cache_with_partial_reponses_2.json | 7 - .../server_cache_with_partial_reponses_3.json | 7 - .../server_cache_with_rec_1.json | 14 - .../server_cache_with_rec_2.json | 8 - .../server_cache_with_rec_3.json | 8 - .../server_cache_with_rec_4.json | 18 - .../server_cache_with_rec_5.json | 8 - .../server_cache_with_svc_obj_1.json | 8 - .../server_cache_with_svc_obj_2.json | 8 - .../server_cache_with_svc_obj_3.json | 8 - .../server_cache_with_ttl_1.json | 26 - .../server_cache_with_ttl_2.json | 26 - .../server_cache_with_union_1.json | 10 - .../server_cache_with_union_2.json | 8 - .../server_cache_with_union_3.json | 8 - .../server_cache_with_union_4.json | 18 - .../server_cache_with_unions_1.json | 8 - .../server_cache_with_unions_2.json | 8 - .../server_cache_with_unions_3.json | 8 - ...t_array_with_fragment_returning_error.json | 30 - ...ect_array_with_invalid_response_order.json | 30 - ...ervice_object_defined_as_record_field.json | 10 - .../service_with_other_annotations.json | 5 - .../subscription_invalid_field.json | 13 - ...ntities_resolver_returning_null_value.json | 5 - .../test_quering_on_interface.json | 8 - ...ying_fragment_on_transitive_interface.json | 22 - .../test_querying_on_transitive_type.json | 7 - ...ying_on_transitive_type_and_interface.json | 9 - ...r_returning_record_with_object_fields.json | 15 - .../expected_results/type_introspection.json | 18 - .../type_introspection_in_invalid_place.json | 13 - ...pe_introspection_on_non_existing_type.json | 5 - .../type_introspection_with_alias.json | 8 - .../type_introspection_without_fields.json | 13 - ...rospection_without_type_name_argument.json | 13 - .../type_name_introspection_in_fragments.json | 13 - ...on_on_nullable_union_of_service_types.json | 15 - .../type_name_introspection_on_operation.json | 5 - ...pe_name_introspection_on_record_types.json | 7 - ...e_name_introspection_on_service_types.json | 8 - ...ntrospection_on_union_of_record_types.json | 31 - ...trospection_on_union_of_service_types.json | 14 - .../typename_introspection_on_field.json | 21 - .../typename_introspection_on_scalar.json | 13 - ...introspection_on_schema_introspection.json | 76 - ...typename_introspection_on_type_record.json | 7 - ...g_entities_field_with_object_variable.json | 8 - .../union_of_distinct_service_objects.json | 8 - ...ervices_array_query_on_selected_types.json | 10 - ...ry_on_selected_types_fragment_on_root.json | 10 - ...inct_services_query_on_selected_types.json | 5 - .../expected_results/union_type_names.json | 120 - ...union_types_with_field_returning_enum.json | 8 - ..._types_with_missing_types_in_document.json | 19 - ...pes_in_document_with_inline_fragments.json | 21 - ..._object_includes_field_returning_enum.json | 11 - .../unknown_inline_fragment.json | 13 - .../valid_complexity_query.json | 9 - ..._value_with_coerce_int_input_to_float.json | 5 - .../variables_inside_list_value.json | 15 - ...iables_with_coerce_int_input_to_float.json | 5 - .../variables_with_default_null_value.json | 5 - .../variables_with_default_values.json | 9 - .../variables_with_multiple_operations.json | 8 - .../variables_with_nested_map.json | 11 - .../variables_with_query_and_mutation.json | 8 - .../tests/resources/files/sample1.json | 3 - ballerina-tests/tests/test_services.bal | 3074 ----------------- build-config/resources/BallerinaTest.toml | 9 +- .../resources/BallerinaTestCommon.toml | 4 + 1909 files changed, 19382 insertions(+), 21565 deletions(-) delete mode 100644 ballerina-tests/Ballerina.toml delete mode 100644 ballerina-tests/Dependencies.toml create mode 100644 ballerina-tests/README.md create mode 100644 ballerina-tests/graphql-advanced-test-suite/object_types.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/records.bal rename ballerina-tests/{tests/27_context.bal => graphql-advanced-test-suite/tests/01_context.bal} (58%) rename ballerina-tests/{tests/30_file_upload.bal => graphql-advanced-test-suite/tests/02_file_upload.bal} (81%) rename ballerina-tests/{tests/39_field_object.bal => graphql-advanced-test-suite/tests/03_field_object.bal} (74%) create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/04_constraint_validation.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/05_server_caches.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/06_query_complexity.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/listeners.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/object_types.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/records.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_mutation.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_union_types.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/constraints.graphql rename ballerina-tests/{ => graphql-advanced-test-suite}/tests/resources/documents/field_object.graphql (54%) create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object_parameter_order.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/invalid_complexity_query.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_arrays.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_service_obj.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_union.graphql rename ballerina-tests/{ => graphql-advanced-test-suite}/tests/resources/documents/server_cache_fields_with_TTL.graphql (51%) create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_operations_with_TTL.graphql rename ballerina-tests/{ => graphql-advanced-test-suite}/tests/resources/documents/server_cache_records_with_non_optional_fields_1.graphql (100%) rename ballerina-tests/{ => graphql-advanced-test-suite}/tests/resources/documents/server_cache_records_with_non_optional_fields_2.graphql (100%) create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_arrays.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_dynamic_responses.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors_2.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_input_object.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_inputs.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_input.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_inputs.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_null_values.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_nullable_inputs.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_partial_responses.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_eviction.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_operations.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_service_obj.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_union.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_unions_operational_level.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/valid_complexity_query.graphql create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_mutation.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_union_types.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_configuration.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_intersection_types.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_list_type_inputs.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_mutation.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_with_multiple_args.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/invalid_complexity_query.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_10.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_5.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_9.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_5.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_6.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_7.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_5.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_5.json rename ballerina-tests/{tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json => graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_6.json} (54%) create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_7.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_8.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_5.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_4.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_1.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_2.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_3.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/valid_complexity_query.json create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample1.json rename ballerina-tests/{ => graphql-advanced-test-suite}/tests/resources/files/sample2.txt (100%) rename ballerina-tests/{ => graphql-advanced-test-suite}/tests/resources/files/sample3.xml (100%) create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/services.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/tests/values.bal create mode 100644 ballerina-tests/graphql-advanced-test-suite/values.bal rename ballerina-tests/{tests/35_client_test.bal => graphql-client-test-suite/tests/01_client_test.bal} (71%) create mode 100644 ballerina-tests/graphql-client-test-suite/tests/listeners.bal create mode 100644 ballerina-tests/graphql-client-test-suite/tests/records.bal create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/documents/alias.graphql create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/documents/fragments_on_record_objects.graphql create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/documents/inline_fragment.graphql create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql rename ballerina-tests/{ => graphql-client-test-suite}/tests/resources/documents/nested_fragments.graphql (53%) create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/fragments_on_record_objects.json create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/inline_fragment.json create mode 100644 ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/nested_fragments.json create mode 100644 ballerina-tests/graphql-client-test-suite/tests/services.bal create mode 100644 ballerina-tests/graphql-client-test-suite/tests/values.bal rename ballerina-tests/{tests/41_dataloader.bal => graphql-dataloader-test-suite/tests/01_dataloader_tests.bal} (56%) create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/batch_load_functions.bal (100%) create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/interceptors.bal create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/listeners.bal create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/object_types.bal create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/records.bal rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/batch_function_returing_errors.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/batch_function_returning_non_matcing_number_of_results.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/dataloader_with_different_alias_for_same_field.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/dataloader_with_interceptor.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/dataloader_with_mutation.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/dataloader_with_query.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/dataloader_with_subscription.graphql (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/server_cache_eviction_with_dataloader.graphql (96%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql (96%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/server_cache_with_dataloader.graphql (96%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/documents/server_cache_with_dataloader_operational.graphql (96%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/expected_results/batch_function_returing_errors.json (57%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/expected_results/batch_function_returning_non_matcing_number_of_results.json (100%) rename ballerina-tests/{ => graphql-dataloader-test-suite}/tests/resources/expected_results/data_loader_with_subscription.json (100%) create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_interceptor.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_mutation.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_query.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_1.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_2.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_3.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_4.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_5.json create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/services.bal create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/utils.bal create mode 100644 ballerina-tests/graphql-dataloader-test-suite/tests/values.bal rename ballerina-tests/{tests/38_interceptors.bal => graphql-interceptor-test-suite/tests/01_interceptor_tests.bal} (55%) create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/02_interceptors_with_server_cache.bal rename ballerina-tests/{ => graphql-interceptor-test-suite}/tests/interceptors.bal (99%) create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/listeners.bal create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/object_types.bal create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/records.bal create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/duplicate_interceptors.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/execute_same_interceptor_multiple_times.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptor_execution_order.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error1.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error2.graphql rename ballerina-tests/{tests/resources/documents/interceptors_returning_invalid_value.graphql => graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error3.graphql} (58%) create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_invalid_value.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_arrays.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification1.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification2.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_enum.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_hierarchical_paths.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_map.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_mutation.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value1.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value2.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_record_fields.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records_and_fragments.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_service_object.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_table.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_union.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/resource_interceptors.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_eviction_with_interceptors.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_with_interceptors.graphql create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/duplicate_interceptors.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/execute_same_interceptor_multiple_times.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptor_execution_order.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error1.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error2.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error3.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_invalid_value.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_arrays.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification1.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification2.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_enum.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_fragments.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_hierarchical_paths.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_map.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_mutation.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value1.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value2.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_record_fields.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records_and_fragments.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_service_object.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_table.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_union.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/resource_interceptors.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_1.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_2.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_3.json create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/services.bal create mode 100644 ballerina-tests/graphql-interceptor-test-suite/tests/values.bal rename ballerina-tests/{tests/18_auth_listener_configs.bal => graphql-security-test-suite/tests/01_auth_listener_configs.bal} (59%) create mode 100644 ballerina-tests/graphql-security-test-suite/tests/02_graphiql_secure_endpoint.bal create mode 100644 ballerina-tests/graphql-security-test-suite/tests/03_client_security.bal rename ballerina-tests/{ => graphql-security-test-suite}/tests/Config.toml (100%) create mode 100644 ballerina-tests/graphql-security-test-suite/tests/listeners.bal rename ballerina-tests/{ => graphql-security-test-suite}/tests/resources/cert/public.crt (100%) rename ballerina-tests/{ => graphql-security-test-suite}/tests/resources/key/private.key (100%) rename ballerina-tests/{ => graphql-security-test-suite}/tests/resources/keystore/ballerinaKeystore.p12 (100%) rename ballerina-tests/{ => graphql-security-test-suite}/tests/resources/keystore/ballerinaTruststore.p12 (100%) create mode 100644 ballerina-tests/graphql-security-test-suite/tests/services.bal rename ballerina-tests/{tests/auth_test_utils.bal => graphql-security-test-suite/tests/utils.bal} (96%) rename ballerina-tests/{ => graphql-service-test-suite}/custom_prefix_without_import.bal (100%) rename ballerina-tests/{objects.bal => graphql-service-test-suite/object_types.bal} (54%) rename ballerina-tests/{ => graphql-service-test-suite}/services.bal (51%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/01_listener_test.bal (56%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/02_request_validation.bal rename ballerina-tests/{ => graphql-service-test-suite}/tests/03_document_validation.bal (86%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/04_input_parameters.bal (76%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/05_record_objects.bal (78%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/06_runtime_errors.bal (85%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/07_service_objects.bal (79%) rename ballerina-tests/{tests/09_arrays.bal => graphql-service-test-suite/tests/08_arrays.bal} (71%) rename ballerina-tests/{tests/10_introspection_queries.bal => graphql-service-test-suite/tests/09_introspection_queries.bal} (90%) rename ballerina-tests/{tests/11_configurations_test.bal => graphql-service-test-suite/tests/10_configurations_test.bal} (84%) rename ballerina-tests/{tests/12_hierarchical_resource_paths.bal => graphql-service-test-suite/tests/11_hierarchical_resource_paths.bal} (83%) rename ballerina-tests/{tests/13_tables.bal => graphql-service-test-suite/tests/12_tables.bal} (77%) rename ballerina-tests/{tests/14_fragments.bal => graphql-service-test-suite/tests/13_fragments.bal} (83%) rename ballerina-tests/{tests/15_enums.bal => graphql-service-test-suite/tests/14_enums.bal} (78%) rename ballerina-tests/{tests/16_maps.bal => graphql-service-test-suite/tests/15_maps.bal} (75%) rename ballerina-tests/{tests/17_recursive_types.bal => graphql-service-test-suite/tests/16_recursive_types.bal} (77%) rename ballerina-tests/{tests/19_distinct_service_unions.bal => graphql-service-test-suite/tests/17_distinct_service_unions.bal} (82%) rename ballerina-tests/{tests/20_document_with_duplicate_fields.bal => graphql-service-test-suite/tests/18_document_with_duplicate_fields.bal} (90%) rename ballerina-tests/{tests/21_aliases.bal => graphql-service-test-suite/tests/19_aliases.bal} (80%) rename ballerina-tests/{tests/22_variables.bal => graphql-service-test-suite/tests/20_variables.bal} (82%) rename ballerina-tests/{tests/23_mutations.bal => graphql-service-test-suite/tests/21_mutations.bal} (78%) rename ballerina-tests/{tests/24_block_strings.bal => graphql-service-test-suite/tests/22_block_strings.bal} (81%) rename ballerina-tests/{tests/25_input_objects.bal => graphql-service-test-suite/tests/23_input_objects.bal} (82%) rename ballerina-tests/{tests/26_nullable_values.bal => graphql-service-test-suite/tests/24_nullable_values.bal} (86%) rename ballerina-tests/{tests/28_directives.bal => graphql-service-test-suite/tests/25_directives.bal} (75%) rename ballerina-tests/{tests/29_list_type_inputs.bal => graphql-service-test-suite/tests/26_list_type_inputs.bal} (88%) rename ballerina-tests/{tests/31_intersection_types.bal => graphql-service-test-suite/tests/27_intersection_types.bal} (86%) rename ballerina-tests/{tests/32_decimal_type.bal => graphql-service-test-suite/tests/28_decimal_type.bal} (73%) rename ballerina-tests/{tests/33_nullable_inputs.bal => graphql-service-test-suite/tests/29_nullable_inputs.bal} (78%) rename ballerina-tests/{tests/34_graphiql_client.bal => graphql-service-test-suite/tests/30_graphiql_client.bal} (62%) rename ballerina-tests/{tests/37_interfaces.bal => graphql-service-test-suite/tests/31_interfaces.bal} (82%) rename ballerina-tests/{tests/43_id_input_type_validation.bal => graphql-service-test-suite/tests/32_id_input_type_validation.bal} (83%) rename ballerina-tests/{tests/test_listeners.bal => graphql-service-test-suite/tests/listeners.bal} (60%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/object_types.bal (51%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/records.bal (79%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_error_path.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_hierarchical_resources.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_service_objects_union.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_with_invalid_field_name.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/arrays_with_errors_in_record_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/ballerina_record_as_graphql_object.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_double_quotes.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/block_strings_with_escaped_character.graphql (50%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/block_strings_with_variable_default_value.graphql (97%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/coerce_decimal_to_float.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_input_to_float.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql (96%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query_with_other_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_service.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_input.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_input.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_default_input.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/decimal_type_list_with_variable_input.graphql (97%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_default_value.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/decimal_type_with_input_object_variable.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_infinity.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/decimal_with_negative_zero.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_positive_infinity.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/default_values_in_input_object_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/directive_locations.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_skip_all_selections.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_duplicate_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_service_returning_objects_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_variables_and_fragments.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/documentation.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_arguments.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_record_types.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_inline_fragments.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/duplicate_input_variables.graphql (97%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_block_string.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_string.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter_as_string.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_inside_record.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_invalid_input_parameter.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/enum_type_default_value_with_variables.graphql (96%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/enum_type_variables.graphql (95%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_value_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_union.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/enum_with_values_assigned_using_variables.graphql (58%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_as_input.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/float_type_variable_with_default_value.graphql (97%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/fragment_on_invalid_type.graphql (65%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_with_invalid_field.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql (58%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_on_record_objects.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/fragments_querying_service_objects.graphql (50%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_input_variables.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/fragments_with_introspection.graphql (51%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/fragments_with_invalid_introspection.graphql (50%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql rename ballerina-tests/{tests/resources/documents/resolver_returning_tables.graphql => graphql-service-test-suite/tests/resources/documents/functions_with_input_parameter.graphql} (55%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_complete.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql rename ballerina-tests/{tests/resources/documents/interceptors_with_null_value1.graphql => graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql} (50%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array1.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_or_nil.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int1.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_or_nil.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_or_nil.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_introspection_query.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragment.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_on_record_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_type_variables_inside_list_value.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql (97%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_default_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_duplicate_fields.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/input_object_with_enum_type_argument.graphql (95%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/input_object_with_float_type_variables.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_fragment_and_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments1.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments2.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/input_object_with_invalid_type_variables1.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables2.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_arguments.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_variables_arguments.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/input_object_with_nested_input_object_variables.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_object.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_undefined_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_unexpected_variable_values.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/input_object_with_variables.graphql (97%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_without_optional_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_escape_characters.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_unicode_characters.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/interfaces_implementing_interface_introsepction.graphql (100%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_interface_type_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_invalid_field.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/interfaces_with_nested_fragments.graphql (50%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_type_name_introspection.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/intersection_types.graphql (100%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/introspection_on_input_object_having_defaultable_fields.graphql (100%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/introspection_on_inputs_with_default_values.graphql (100%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_service_with_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_query_with_missing_selection.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/invalid_block_strings.graphql (98%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_hierarchical_resource_paths.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_introspection_query.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_for_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/invalid_mutation.graphql (54%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_from_service_object_resource.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_schema_introspection_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_spread_inline_fragments.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_variables_inside_list_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_empty_value.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_input_with_invalid_variables.graphql (52%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_null_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_variable.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_inputs_with_nested_list.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_inside_list_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_default_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_enum_values.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_enum_values.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql (73%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql (74%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql (65%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql (67%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql (57%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_variable_default_values_1.graphql (75%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_variable_default_values_2.graphql (56%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_variable_default_values_3.graphql (71%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_variable_default_values_4.graphql (67%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_5.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_6.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_7.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_8.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/list_type_with_variable_default_values_9.graphql (66%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects_with_variables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/map.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_invalid_key.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_valid_key.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_without_key_input.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_directive_usage_in_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations_on_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_variable_types_with_single_query.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_type_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/named_fragments_with_duplicate_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql (55%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map_without_key_input.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_records_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_list.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql (95%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_as_enum_input_with_variable_value.graphql (95%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_resource_function_name.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_input_for_nullable_record_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql (95%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql (97%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql (52%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql (97%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql (52%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_list.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_record.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_without_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/nullable_variables_without_value.graphql (95%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_arrays_with_invalid_query.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_with_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_without_value.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_type_introspection.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_with_default_parameter.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_without_default_parameter.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_subfields_on_type_name.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_table_without_selections.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/record_type_arrays.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field_from_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/requesting_object_without_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_map_of_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables_with_errors.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_arrays_missing_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_tables.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array_with_errors.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_recursive_service_type.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_union_of_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays_with_errors.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_invalid_response_order.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_defined_as_record_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_with_other_annotations.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/test_quering_on_interface.graphql (100%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/test_querying_fragment_on_transitive_interface.graphql (100%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/test_querying_on_transitive_type.graphql (100%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/test_querying_on_transitive_type_and_interface.graphql (100%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection.graphql rename ballerina-tests/{tests/resources/documents/typename_introspection_on_type_record.graphql => graphql-service-test-suite/tests/resources/documents/type_introspection_in_invalid_place.graphql} (53%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_on_non_existing_type.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_with_alias.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_fields.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_type_name_argument.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_in_fragments.graphql rename ballerina-tests/{tests/resources/documents/type_name_introspection_in_fragments.graphql => graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql} (55%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_operation.graphql rename ballerina-tests/{tests/resources/documents/type_name_introspection_on_operation.graphql => graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_record_types.graphql} (51%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_service_types.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_field.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_scalar.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/typename_introspection_on_schema_introspection.graphql (100%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_type_record.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_service_objects.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_type_names.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_field_returning_enum.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/unknown_inline_fragment.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_inside_list_value.graphql rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql (96%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/documents/variables_with_default_null_value.graphql (96%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_values.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_multiple_operations.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_nested_map.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_query_and_mutation.graphql create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_error_path.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_hierarchical_resources.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_service_objects_union.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_with_invalid_field_name.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/arrays_with_errors_in_record_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/ballerina_record_as_graphql_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_double_quotes.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_escaped_character.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_variable_default_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_decimal_to_float.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_input_to_float.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query_with_other_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_service.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_default_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_variable_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_default_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_variable.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_infinity.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_zero.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_positive_infinity.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/default_values_in_input_object_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directive_locations.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_skip_all_selections.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_duplicate_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_service_returning_objects_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_variables_and_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/documentation.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_3.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_record_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_inline_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_input_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_block_string.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_string.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter_as_string.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_inside_record.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_invalid_input_parameter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_default_value_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_value_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_union.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned_using_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_as_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_type_variable_with_default_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_on_invalid_type.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_with_invalid_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_on_record_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_querying_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_input_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_invalid_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/functions_with_input_parameter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/graphql_playground_introspection_query.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_complete.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_or_nil.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_or_nil.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_or_nil.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_introspection_query.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragment.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_on_record_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_type_variables_inside_list_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_default_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_duplicate_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_enum_type_argument.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_float_type_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_fragment_and_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_arguments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_variables_arguments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_input_object_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_undefined_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_unexpected_variable_values.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_without_optional_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_escape_characters.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_unicode_characters.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces.json rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/expected_results/interfaces_implementing_interface_introsepction.json (100%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_interface_type_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_invalid_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_nested_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_type_name_introspection.json rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/expected_results/introspection_on_input_object_having_defaultable_fields.json (100%) rename ballerina-tests/{ => graphql-service-test-suite}/tests/resources/expected_results/introspection_on_inputs_with_default_values.json (100%) create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_service_with_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_query_with_missing_selection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_block_strings.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_hierarchical_resource_paths.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_introspection_query.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_for_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_mutation.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_from_service_object_resource.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_schema_introspection_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_spread_inline_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_variables_inside_list_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_empty_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_invalid_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_null_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_variable.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_inputs_with_nested_list.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_inside_list_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_default_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_enum_values.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_enum_values.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_3.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_4.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_5.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_6.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_7.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_8.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_9.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_invalid_key.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_valid_key.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_without_key_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_directive_usage_in_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations_on_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_variable_types_with_single_query.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_type_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/named_fragments_with_duplicate_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map_without_key_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_records_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_list.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input_with_variable_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_resource_function_name.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_input_for_nullable_record_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_list.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_record.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_without_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_variables_without_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_arrays_with_invalid_query.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_with_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_without_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter_reference.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_type_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_with_default_parameter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_without_default_parameter.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_subfields_on_type_name.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_table_without_selections.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/record_type_arrays.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field_from_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/requesting_object_without_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_map_of_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables_with_errors.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_arrays_missing_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_tables.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array_with_errors.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_recursive_service_type.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_union_of_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays_with_errors.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_invalid_response_order.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_defined_as_record_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_with_other_annotations.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_quering_on_interface.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_in_invalid_place.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_on_non_existing_type.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_with_alias.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_fields.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_type_name_argument.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_in_fragments.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_operation.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_record_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_service_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_field.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_scalar.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_schema_introspection.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_type_record.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_service_objects.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_type_names.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_field_returning_enum.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/unknown_inline_fragment.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_inside_list_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_null_value.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_values.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_multiple_operations.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_nested_map.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_query_and_mutation.json create mode 100644 ballerina-tests/graphql-service-test-suite/tests/services.bal rename ballerina-tests/{ => graphql-service-test-suite}/tests/values.bal (66%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/entities.bal (82%) create mode 100644 ballerina-tests/graphql-subgraph-test-suite/records.bal rename ballerina-tests/{ => graphql-subgraph-test-suite}/subgraphs.bal (86%) rename ballerina-tests/{tests/40_subgraph.bal => graphql-subgraph-test-suite/tests/01_subgraph_tests.bal} (73%) create mode 100644 ballerina-tests/graphql-subgraph-test-suite/tests/listeners.bal rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/introspection_on_subgraph.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_entities_field_on_subgraph.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_entities_field_with_list_of_non_any_argument.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_entities_field_with_list_of_null_values.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_entities_field_with_null_argument.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_entities_field_with_object_argument.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_entities_field_without_typename_in_argument.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/querying_subgraph_with_variable.graphql (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/documents/test_reference_resolver_returning_record_with_object_fields.graphql (100%) create mode 100644 ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/introspection_on_subgraph.json create mode 100644 ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/quering_sdl_on_subgraph.json rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_on_subgraph.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_argument.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_variable.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_list_of_null_values.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_list_of_null_variable.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_null_argument.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_null_variable.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_object_argument.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_object_variable.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_with_variable_on_subgraph.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_without_typename_in_argument.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/querying_entities_field_without_typename_in_variable.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/test_entities_resolver_returnig_error_for_unresolvable_entity.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_return_type.json (100%) rename ballerina-tests/{ => graphql-subgraph-test-suite}/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_typename.json (100%) create mode 100644 ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_null_value.json create mode 100644 ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json create mode 100644 ballerina-tests/graphql-subgraph-test-suite/values.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/records.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/constraints.graphql create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_fragments.graphql create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_multiple_operations.graphql create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_records.graphql create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_service_objects.graphql rename ballerina-tests/{ => graphql-subscription-test-suite}/tests/resources/documents/subscriptions_with_union_type.graphql (51%) create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_variable_values.graphql create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/constraints_with_subscription.json create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/errors_in_streams.json create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/subscription_invalid_field.json create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/services.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/values.bal create mode 100644 ballerina-tests/graphql-test-common/Package.md create mode 100644 ballerina-tests/graphql-test-common/constants.bal rename ballerina-tests/{tests => graphql-test-common}/utils.bal (52%) delete mode 100644 ballerina-tests/tests/02_request_validation.bal delete mode 100644 ballerina-tests/tests/36_subscriptions.bal delete mode 100644 ballerina-tests/tests/42_constraint_validation.bal delete mode 100644 ballerina-tests/tests/44_server_caches.bal delete mode 100644 ballerina-tests/tests/45_query_complexity.bal delete mode 100644 ballerina-tests/tests/README.md delete mode 100644 ballerina-tests/tests/resources/documents/alias.graphql delete mode 100644 ballerina-tests/tests/resources/documents/alias_on_error_path.graphql delete mode 100644 ballerina-tests/tests/resources/documents/alias_on_hierarchical_resources.graphql delete mode 100644 ballerina-tests/tests/resources/documents/alias_on_service_objects_union.graphql delete mode 100644 ballerina-tests/tests/resources/documents/alias_with_invalid_field_name.graphql delete mode 100644 ballerina-tests/tests/resources/documents/arrays_with_errors_in_record_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql delete mode 100644 ballerina-tests/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql delete mode 100644 ballerina-tests/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql delete mode 100644 ballerina-tests/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql delete mode 100644 ballerina-tests/tests/resources/documents/ballerina_record_as_graphql_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/block_strings.graphql delete mode 100644 ballerina-tests/tests/resources/documents/block_strings_with_double_quotes.graphql delete mode 100644 ballerina-tests/tests/resources/documents/coerce_int_input_to_float.graphql delete mode 100644 ballerina-tests/tests/resources/documents/coerce_int_to_decimal.graphql delete mode 100644 ballerina-tests/tests/resources/documents/complex_introspection_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/complex_introspection_query_with_other_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/complex_service.graphql delete mode 100644 ballerina-tests/tests/resources/documents/complexity_with_mutation.graphql delete mode 100644 ballerina-tests/tests/resources/documents/complexity_with_union_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/constraints.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_default_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_list_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_list_with_default_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_variable_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_with_input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_type_with_input_object_default_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_with_marginal_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_with_negative_infinity.graphql delete mode 100644 ballerina-tests/tests/resources/documents/decimal_with_positive_infinity.graphql delete mode 100644 ballerina-tests/tests/resources/documents/default_values_in_input_object_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/deprecated_fields_filtering.graphql delete mode 100644 ballerina-tests/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/deprecated_fields_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/directive_locations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/directives.graphql delete mode 100644 ballerina-tests/tests/resources/documents/directives_skip_all_selections.graphql delete mode 100644 ballerina-tests/tests/resources/documents/directives_with_duplicate_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/directives_with_service_returning_objects_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/directives_with_variables_and_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/documentation.graphql delete mode 100644 ballerina-tests/tests/resources/documents/duplicate_fields_with_arguments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/duplicate_fields_with_record_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/duplicate_inline_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/duplicate_interceptors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/empty_block_string.graphql delete mode 100644 ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/empty_string.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_input_parameter.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_input_parameter_as_string.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_inside_record.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_invalid_input_parameter.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_value_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_with_union.graphql delete mode 100644 ballerina-tests/tests/resources/documents/enum_with_values_assigned.graphql delete mode 100644 ballerina-tests/tests/resources/documents/execute_same_interceptor_multiple_times.graphql delete mode 100644 ballerina-tests/tests/resources/documents/field_object_parameter_order.graphql delete mode 100644 ballerina-tests/tests/resources/documents/float_as_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/float_with_negative_infinity.graphql delete mode 100644 ballerina-tests/tests/resources/documents/float_with_positive_infinity.graphql delete mode 100644 ballerina-tests/tests/resources/documents/fragment_with_invalid_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/fragments_on_record_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/fragments_with_input_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql delete mode 100644 ballerina-tests/tests/resources/documents/functions_with_input_parameter.graphql delete mode 100644 ballerina-tests/tests/resources/documents/graphql_playground_introspection_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_complete.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_decimal.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_float.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_float_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_float_array1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_float_or_nil.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_int.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_int1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_int_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_int_or_nil.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_return_record.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_return_record_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_string.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_string_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_string_or_nil.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_uuid.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql delete mode 100644 ballerina-tests/tests/resources/documents/id_introspection_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/inline_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/inline_fragments_on_record_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/inline_fragments_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_include_fields_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_type_variables_inside_list_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_default_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_duplicate_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_fragment_and_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_missing_arguments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_missing_variables_arguments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_nested_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_undefined_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_with_unexpected_variable_values.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_object_without_optional_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_with_escape_characters.graphql delete mode 100644 ballerina-tests/tests/resources/documents/input_with_unicode_characters.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptor_execution_order.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_returning_error1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_returning_error2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_returning_error3.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_arrays.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_enum.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_hierarchical_paths.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_map.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_mutation.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_null_value2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_record_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_records.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_records_and_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_service_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_records.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_table.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interceptors_with_union.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interface_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interface_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interfaces.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interfaces_with_interface_type_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interfaces_with_invalid_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/interfaces_with_type_name_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/introspection_for_person_and_greet.graphql delete mode 100644 ballerina-tests/tests/resources/documents/introspection_on_service_with_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/introspection_query_with_missing_selection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_complexity_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_hierarchical_resource_paths.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_introspection_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_list_type_for_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_query_from_service_object_resource.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_schema_introspection_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_spread_inline_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/invalid_variables_inside_list_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_input_with_empty_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_input_with_null_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_input_with_variable.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_inputs_with_nested_list.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_variables_inside_list_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_variables_with_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_default_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_enum_values.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_enum_values.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_5.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_6.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_7.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_8.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_within_input_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/list_type_within_input_objects_with_variables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/map.graphql delete mode 100644 ballerina-tests/tests/resources/documents/map_with_invalid_key.graphql delete mode 100644 ballerina-tests/tests/resources/documents/map_with_valid_key.graphql delete mode 100644 ballerina-tests/tests/resources/documents/map_without_key_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/multiple_directive_usage_in_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/multiple_mutations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/multiple_mutations_on_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql delete mode 100644 ballerina-tests/tests/resources/documents/multiple_variable_types_with_single_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/mutation.graphql delete mode 100644 ballerina-tests/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql delete mode 100644 ballerina-tests/tests/resources/documents/mutation_type_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/named_fragments_with_duplicate_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nested_map.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nested_map_without_key_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nested_records_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/non_null_input_for_nullable_list.graphql delete mode 100644 ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record.graphql delete mode 100644 ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql delete mode 100644 ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_as_enum_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_as_resource_function_name.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_as_scalar_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_input_for_nullable_record_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_value_for_non_null_argument.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql delete mode 100644 ballerina-tests/tests/resources/documents/null_value_in_input_object_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nullable_input_for_nullable_list.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nullable_input_for_nullable_record.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nullable_list_type_input_without_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/optional_arrays_with_invalid_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/optional_enum_argument_with_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/optional_enum_argument_without_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/query_type_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/query_union_type.graphql delete mode 100644 ballerina-tests/tests/resources/documents/query_with_default_parameter.graphql delete mode 100644 ballerina-tests/tests/resources/documents/query_without_default_parameter.graphql delete mode 100644 ballerina-tests/tests/resources/documents/querying_subfields_on_type_name.graphql delete mode 100644 ballerina-tests/tests/resources/documents/querying_table_without_selections.graphql delete mode 100644 ballerina-tests/tests/resources/documents/record_type_arrays.graphql delete mode 100644 ballerina-tests/tests/resources/documents/request_invalid_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/request_invalid_field_from_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/requesting_object_without_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resolver_returning_map_of_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resolver_returning_tables_with_errors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resource_interceptors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resource_returning_arrays_missing_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resource_returning_service_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resource_returning_service_object_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/resource_returning_tables.graphql delete mode 100644 ballerina-tests/tests/resources/documents/returning_enum_array.graphql delete mode 100644 ballerina-tests/tests/resources/documents/returning_enum_array_with_errors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/returning_recursive_service_type.graphql delete mode 100644 ballerina-tests/tests/resources/documents/returning_union_of_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/same_field_with_multiple_alias.graphql delete mode 100644 ballerina-tests/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/scalar_arrays.graphql delete mode 100644 ballerina-tests/tests/resources/documents/scalar_arrays_with_errors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction_with_arrays.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction_with_interceptors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction_with_service_obj.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_eviction_with_union.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_input_object_parameters.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_list_inputs.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_operations_with_TTL.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_arrays.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_dynamic_responses.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_errors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_errors_2.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_input_object.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_inputs.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_interceptors.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_list_input.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_list_inputs.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_null_values.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_nullable_inputs.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_partial_responses.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_records.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_records_eviction.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_records_operations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_service_obj.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_union.graphql delete mode 100644 ballerina-tests/tests/resources/documents/server_cache_with_unions_operational_level.graphql delete mode 100644 ballerina-tests/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql delete mode 100644 ballerina-tests/tests/resources/documents/service_object_array_with_invalid_response_order.graphql delete mode 100644 ballerina-tests/tests/resources/documents/service_object_defined_as_record_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/service_with_other_annotations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/subscriptions_with_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/subscriptions_with_multiple_operations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/subscriptions_with_records.graphql delete mode 100644 ballerina-tests/tests/resources/documents/subscriptions_with_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/subscriptions_with_variable_values.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_introspection.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_introspection_in_invalid_place.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_introspection_on_non_existing_type.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_introspection_with_alias.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_introspection_without_fields.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_introspection_without_type_name_argument.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_name_introspection_on_record_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_name_introspection_on_service_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/typename_introspection_on_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/typename_introspection_on_scalar.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_of_distinct_service_objects.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_type_as_record_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_type_as_record_field_without_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_type_names.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_type_with_field_and_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_type_with_fragment_and_field.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_type_with_incorrect_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_types_with_field_returning_enum.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_types_with_missing_types_in_document.graphql delete mode 100644 ballerina-tests/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql delete mode 100644 ballerina-tests/tests/resources/documents/unknown_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/unknown_inline_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/unknown_nested_fragments.graphql delete mode 100644 ballerina-tests/tests/resources/documents/unused_fragment.graphql delete mode 100644 ballerina-tests/tests/resources/documents/valid_complexity_query.graphql delete mode 100644 ballerina-tests/tests/resources/documents/variables_inside_list_value.graphql delete mode 100644 ballerina-tests/tests/resources/documents/variables_with_default_values.graphql delete mode 100644 ballerina-tests/tests/resources/documents/variables_with_multiple_operations.graphql delete mode 100644 ballerina-tests/tests/resources/documents/variables_with_nested_map.graphql delete mode 100644 ballerina-tests/tests/resources/documents/variables_with_query_and_mutation.graphql delete mode 100644 ballerina-tests/tests/resources/expected_results/alias.json delete mode 100644 ballerina-tests/tests/resources/expected_results/alias_on_error_path.json delete mode 100644 ballerina-tests/tests/resources/expected_results/alias_on_hierarchical_resources.json delete mode 100644 ballerina-tests/tests/resources/expected_results/alias_on_service_objects_union.json delete mode 100644 ballerina-tests/tests/resources/expected_results/alias_with_invalid_field_name.json delete mode 100644 ballerina-tests/tests/resources/expected_results/arrays_with_errors_in_record_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json delete mode 100644 ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json delete mode 100644 ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json delete mode 100644 ballerina-tests/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json delete mode 100644 ballerina-tests/tests/resources/expected_results/ballerina_record_as_graphql_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/block_strings.json delete mode 100644 ballerina-tests/tests/resources/expected_results/block_strings_with_double_quotes.json delete mode 100644 ballerina-tests/tests/resources/expected_results/block_strings_with_escaped_character.json delete mode 100644 ballerina-tests/tests/resources/expected_results/block_strings_with_variable_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/coerce_decimal_to_float.json delete mode 100644 ballerina-tests/tests/resources/expected_results/coerce_int_input_to_float.json delete mode 100644 ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal.json delete mode 100644 ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/complex_introspection_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/complex_introspection_query_with_other_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/complex_service.json delete mode 100644 ballerina-tests/tests/resources/expected_results/complexity_with_mutation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/complexity_with_union_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_configuration.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_with_intersection_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_with_list_type_inputs.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_with_mutation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_with_subscription.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_with_variables_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/constraints_with_variables_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/dataloader_with_interceptor.json delete mode 100644 ballerina-tests/tests/resources/expected_results/dataloader_with_mutation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/dataloader_with_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_list_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_list_with_default_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_list_with_variable_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_variable_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_variable.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_with_marginal_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_with_negative_infinity.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_with_negative_zero.json delete mode 100644 ballerina-tests/tests/resources/expected_results/decimal_with_positive_infinity.json delete mode 100644 ballerina-tests/tests/resources/expected_results/default_values_in_input_object_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering.json delete mode 100644 ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/directive_locations.json delete mode 100644 ballerina-tests/tests/resources/expected_results/directives.json delete mode 100644 ballerina-tests/tests/resources/expected_results/directives_skip_all_selections.json delete mode 100644 ballerina-tests/tests/resources/expected_results/directives_with_duplicate_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/directives_with_service_returning_objects_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/directives_with_variables_and_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/documentation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_record_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_inline_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_input_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_interceptors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json delete mode 100644 ballerina-tests/tests/resources/expected_results/empty_block_string.json delete mode 100644 ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/empty_string.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_input_parameter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_input_parameter_as_string.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_inside_record.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_invalid_input_parameter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_type_default_value_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_type_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_value_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_with_union.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_with_values_assigned.json delete mode 100644 ballerina-tests/tests/resources/expected_results/enum_with_values_assigned_using_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/errors_in_streams.json delete mode 100644 ballerina-tests/tests/resources/expected_results/execute_same_interceptor_multiple_times.json delete mode 100644 ballerina-tests/tests/resources/expected_results/field_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/field_object_parameter_order1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/field_object_parameter_order2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/field_object_with_multiple_args.json delete mode 100644 ballerina-tests/tests/resources/expected_results/float_as_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/float_type_variable_with_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragment_on_invalid_type.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragment_with_invalid_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_on_record_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_querying_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_with_input_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_with_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_with_invalid_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/functions_with_input_parameter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_complete.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_float.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_or_nil.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_int.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_int1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_or_nil.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_string.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_or_nil.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json delete mode 100644 ballerina-tests/tests/resources/expected_results/id_introspection_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/inline_fragment.json delete mode 100644 ballerina-tests/tests/resources/expected_results/inline_fragments_on_record_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/inline_fragments_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables_missing_values.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_type_variables_inside_list_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_duplicate_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_enum_type_argument.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_float_type_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_fragment_and_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_missing_arguments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_missing_variables_arguments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_nested_input_object_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_nested_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_undefined_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_unexpected_variable_values.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_object_without_optional_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_escape_characters.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json delete mode 100644 ballerina-tests/tests/resources/expected_results/input_with_unicode_characters.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptor_execution_order.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_returning_error1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_returning_error2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_returning_error3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_returning_invalid_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_arrays.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_enum.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_hierarchical_paths.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_map.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_mutation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_null_value1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_null_value2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_record_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_records.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_records_and_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_service_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_table.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interceptors_with_union.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interface_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interface_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interfaces.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interfaces_with_interface_type_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interfaces_with_invalid_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interfaces_with_nested_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/interfaces_with_type_name_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/introspection_for_person_and_greet.json delete mode 100644 ballerina-tests/tests/resources/expected_results/introspection_on_service_with_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/introspection_on_subgraph.json delete mode 100644 ballerina-tests/tests/resources/expected_results/introspection_query_with_missing_selection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_block_strings.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_complexity_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_hierarchical_resource_paths.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_introspection_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_list_type_for_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_mutation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_query_from_service_object_resource.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_schema_introspection_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_spread_inline_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/invalid_variables_inside_list_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_input copy.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_input_with_empty_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_input_with_invalid_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_input_with_null_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_input_with_variable.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_inputs_with_nested_list.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_variables_inside_list_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_variables_with_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_default_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_enum_values.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_enum_values.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_8.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_9.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_within_input_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/list_type_within_input_objects_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/map.json delete mode 100644 ballerina-tests/tests/resources/expected_results/map_with_invalid_key.json delete mode 100644 ballerina-tests/tests/resources/expected_results/map_with_valid_key.json delete mode 100644 ballerina-tests/tests/resources/expected_results/map_without_key_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/multiple_directive_usage_in_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/multiple_mutations.json delete mode 100644 ballerina-tests/tests/resources/expected_results/multiple_mutations_on_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/multiple_variable_types_with_single_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/mutation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json delete mode 100644 ballerina-tests/tests/resources/expected_results/mutation_type_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/named_fragments_with_duplicate_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_map.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_map_without_key_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nested_records_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_list.json delete mode 100644 ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record.json delete mode 100644 ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_as_enum_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_as_enum_input_with_variable_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_as_resource_function_name.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_as_scalar_input.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_input_for_nullable_record_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_list.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_record.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nullable_list_type_input_without_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/nullable_variables_without_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/optional_arrays_with_invalid_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/optional_enum_argument_with_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/optional_enum_argument_without_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter_reference.json delete mode 100644 ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/quering_sdl_on_subgraph.json delete mode 100644 ballerina-tests/tests/resources/expected_results/query_type_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/query_with_default_parameter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/query_without_default_parameter.json delete mode 100644 ballerina-tests/tests/resources/expected_results/querying_subfields_on_type_name.json delete mode 100644 ballerina-tests/tests/resources/expected_results/querying_table_without_selections.json delete mode 100644 ballerina-tests/tests/resources/expected_results/record_type_arrays.json delete mode 100644 ballerina-tests/tests/resources/expected_results/request_invalid_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/request_invalid_field_from_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/requesting_object_without_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resolver_returnig_error_for_invalid_entity.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resolver_returning_map_of_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resolver_returning_tables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resolver_returning_tables_with_errors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resource_interceptors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resource_returning_arrays_missing_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resource_returning_service_object.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resource_returning_service_object_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/resource_returning_tables.json delete mode 100644 ballerina-tests/tests/resources/expected_results/returning_enum_array.json delete mode 100644 ballerina-tests/tests/resources/expected_results/returning_enum_array_with_errors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/returning_recursive_service_type.json delete mode 100644 ballerina-tests/tests/resources/expected_results/returning_union_of_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias.json delete mode 100644 ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/scalar_arrays.json delete mode 100644 ballerina-tests/tests/resources/expected_results/scalar_arrays_with_errors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_10.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_8.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_9.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_operation_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_errors_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_errors_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_errors_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_errors_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_errors_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_8.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_6.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_rec_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_rec_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_rec_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_rec_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_rec_5.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_union_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_union_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_union_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_union_4.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_unions_1.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_unions_2.json delete mode 100644 ballerina-tests/tests/resources/expected_results/server_cache_with_unions_3.json delete mode 100644 ballerina-tests/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json delete mode 100644 ballerina-tests/tests/resources/expected_results/service_object_array_with_invalid_response_order.json delete mode 100644 ballerina-tests/tests/resources/expected_results/service_object_defined_as_record_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/service_with_other_annotations.json delete mode 100644 ballerina-tests/tests/resources/expected_results/subscription_invalid_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_null_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/test_quering_on_interface.json delete mode 100644 ballerina-tests/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json delete mode 100644 ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type.json delete mode 100644 ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json delete mode 100644 ballerina-tests/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_introspection_in_invalid_place.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_introspection_on_non_existing_type.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_introspection_with_alias.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_introspection_without_fields.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_introspection_without_type_name_argument.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_in_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_on_operation.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_on_record_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_on_service_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_record_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/typename_introspection_on_field.json delete mode 100644 ballerina-tests/tests/resources/expected_results/typename_introspection_on_scalar.json delete mode 100644 ballerina-tests/tests/resources/expected_results/typename_introspection_on_schema_introspection.json delete mode 100644 ballerina-tests/tests/resources/expected_results/typename_introspection_on_type_record.json delete mode 100644 ballerina-tests/tests/resources/expected_results/uerying_entities_field_with_object_variable.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_of_distinct_service_objects.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_type_names.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_types_with_field_returning_enum.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document_with_inline_fragments.json delete mode 100644 ballerina-tests/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json delete mode 100644 ballerina-tests/tests/resources/expected_results/unknown_inline_fragment.json delete mode 100644 ballerina-tests/tests/resources/expected_results/valid_complexity_query.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_inside_list_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_with_default_null_value.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_with_default_values.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_with_multiple_operations.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_with_nested_map.json delete mode 100644 ballerina-tests/tests/resources/expected_results/variables_with_query_and_mutation.json delete mode 100644 ballerina-tests/tests/resources/files/sample1.json delete mode 100644 ballerina-tests/tests/test_services.bal create mode 100644 build-config/resources/BallerinaTestCommon.toml diff --git a/ballerina-tests/Ballerina.toml b/ballerina-tests/Ballerina.toml deleted file mode 100644 index b15a06ebf..000000000 --- a/ballerina-tests/Ballerina.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -org = "ballerina" -name = "graphql_tests" -version = "1.14.1" - -[build-options] -observabilityIncluded = true diff --git a/ballerina-tests/Dependencies.toml b/ballerina-tests/Dependencies.toml deleted file mode 100644 index 2fa10c1d2..000000000 --- a/ballerina-tests/Dependencies.toml +++ /dev/null @@ -1,424 +0,0 @@ -# AUTO-GENERATED FILE. DO NOT MODIFY. - -# This file is auto-generated by Ballerina for managing dependency versions. -# It should not be modified by hand. - -[ballerina] -dependencies-toml-version = "2" -distribution-version = "2201.10.0" - -[[package]] -org = "ballerina" -name = "auth" -version = "2.12.0" -dependencies = [ - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"} -] - -[[package]] -org = "ballerina" -name = "cache" -version = "3.8.0" -dependencies = [ - {org = "ballerina", name = "constraint"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "constraint" -version = "1.5.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "constraint", moduleName = "constraint"} -] - -[[package]] -org = "ballerina" -name = "crypto" -version = "2.7.2" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "file" -version = "1.10.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "os"}, - {org = "ballerina", name = "time"} -] -modules = [ - {org = "ballerina", packageName = "file", moduleName = "file"} -] - -[[package]] -org = "ballerina" -name = "graphql" -version = "1.14.1" -dependencies = [ - {org = "ballerina", name = "auth"}, - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "file"}, - {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "jwt"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.regexp"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "mime"}, - {org = "ballerina", name = "oauth2"}, - {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"}, - {org = "ballerina", name = "uuid"}, - {org = "ballerina", name = "websocket"} -] -modules = [ - {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, - {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, - {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, - {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} -] - -[[package]] -org = "ballerina" -name = "graphql_tests" -version = "1.14.1" -dependencies = [ - {org = "ballerina", name = "constraint"}, - {org = "ballerina", name = "file"}, - {org = "ballerina", name = "graphql"}, - {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "lang.runtime"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "mime"}, - {org = "ballerina", name = "test"}, - {org = "ballerina", name = "url"}, - {org = "ballerina", name = "uuid"}, - {org = "ballerina", name = "websocket"}, - {org = "ballerinai", name = "observe"} -] -modules = [ - {org = "ballerina", packageName = "graphql_tests", moduleName = "graphql_tests"} -] - -[[package]] -org = "ballerina" -name = "http" -version = "2.12.1" -dependencies = [ - {org = "ballerina", name = "auth"}, - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "constraint"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "file"}, - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "jwt"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.decimal"}, - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "lang.regexp"}, - {org = "ballerina", name = "lang.runtime"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "mime"}, - {org = "ballerina", name = "oauth2"}, - {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "time"}, - {org = "ballerina", name = "url"} -] -modules = [ - {org = "ballerina", packageName = "http", moduleName = "http"}, - {org = "ballerina", packageName = "http", moduleName = "http.httpscerr"} -] - -[[package]] -org = "ballerina" -name = "io" -version = "1.6.1" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.value"} -] -modules = [ - {org = "ballerina", packageName = "io", moduleName = "io"} -] - -[[package]] -org = "ballerina" -name = "jballerina.java" -version = "0.0.0" - -[[package]] -org = "ballerina" -name = "jwt" -version = "2.13.0" -dependencies = [ - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "lang.__internal" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.object"} -] - -[[package]] -org = "ballerina" -name = "lang.array" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.__internal"} -] - -[[package]] -org = "ballerina" -name = "lang.decimal" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.error" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.int" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.__internal"}, - {org = "ballerina", name = "lang.object"} -] - -[[package]] -org = "ballerina" -name = "lang.object" -version = "0.0.0" - -[[package]] -org = "ballerina" -name = "lang.regexp" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.runtime" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "lang.runtime", moduleName = "lang.runtime"} -] - -[[package]] -org = "ballerina" -name = "lang.string" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.regexp"} -] - -[[package]] -org = "ballerina" -name = "lang.value" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "lang.value", moduleName = "lang.value"} -] - -[[package]] -org = "ballerina" -name = "log" -version = "2.10.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "observe"} -] -modules = [ - {org = "ballerina", packageName = "log", moduleName = "log"} -] - -[[package]] -org = "ballerina" -name = "mime" -version = "2.10.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "log"} -] -modules = [ - {org = "ballerina", packageName = "mime", moduleName = "mime"} -] - -[[package]] -org = "ballerina" -name = "oauth2" -version = "2.12.0" -dependencies = [ - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, - {org = "ballerina", name = "url"} -] - -[[package]] -org = "ballerina" -name = "observe" -version = "1.3.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "os" -version = "1.8.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "task" -version = "2.5.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "test" -version = "0.0.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.error"} -] -modules = [ - {org = "ballerina", packageName = "test", moduleName = "test"} -] - -[[package]] -org = "ballerina" -name = "time" -version = "2.4.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "url" -version = "2.4.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "url", moduleName = "url"} -] - -[[package]] -org = "ballerina" -name = "uuid" -version = "1.8.0" -dependencies = [ - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "time"} -] -modules = [ - {org = "ballerina", packageName = "uuid", moduleName = "uuid"} -] - -[[package]] -org = "ballerina" -name = "websocket" -version = "2.12.0" -dependencies = [ - {org = "ballerina", name = "auth"}, - {org = "ballerina", name = "constraint"}, - {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "jwt"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.runtime"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "oauth2"}, - {org = "ballerina", name = "time"} -] -modules = [ - {org = "ballerina", packageName = "websocket", moduleName = "websocket"} -] - -[[package]] -org = "ballerinai" -name = "observe" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "observe"} -] -modules = [ - {org = "ballerinai", packageName = "observe", moduleName = "observe"} -] - diff --git a/ballerina-tests/README.md b/ballerina-tests/README.md new file mode 100644 index 000000000..974b6a106 --- /dev/null +++ b/ballerina-tests/README.md @@ -0,0 +1,40 @@ +## Writing Tests + +The tests for the Ballerina GraphQL module are organized into multiple test suites. When adding a new test, ensure that it is added to the appropriate test suite. Below are the current test suites: + +- **graphql-advanced-test-suite**: Covers test cases for GraphQL context, caching, file uploads, and query complexity. +- **graphql-client-test-suite**: Covers test cases for the Ballerina GraphQL client. +- **graphql-dataloader-test-suite**: Covers test cases related to the DataLoader implementation. +- **graphql-interceptor-test-suite**: Covers test cases for interceptors. +- **graphql-security-test-suite**: Covers test cases for security. +- **graphql-subgraph-test-suite**: Covers federation and subgraph-related implementation. +- **graphql-subscription-test-suite**: Covers subscription-related functionality. +- **graphql-service-test-suite**: Covers the remaining overall GraphQL specification. + +### Test Structure + +### Test Structure + +- **Listeners**: Test listeners are defined in the `/tests/listeners.bal` file. +- **Services**: Test services are defined in the `/tests/services.bal` file. +- **Records, Object Types, and Values**: Ballerina records, object types, and values are defined in the corresponding Ballerina files: + - `/tests/records.bal` + - `/tests/object_types.bal` + - `/tests/values.bal` + +### Handling Large Documents and JSON Files + +For lengthy GraphQL documents, save them as separate `.txt` files in the `/tests/resources/documents` directory. Use the `common:getGraphqlDocumentFromFile()` utility function to read these files, passing the file name as an argument. + +Similarly, when expected JSON results are too large, save them as separate `.json` files in the `/tests/resources/expected_results.json` directory. Use the `common:getJsonContentFromFile()` function to read these files, passing the appropriate file name. + +### Naming Convention + +Name the document and JSON files after the corresponding test functions. For example: + +- A document used in the `testSampleFunctionality` test is saved as `sample_functionality.txt`. +- The expected result is saved as `sample_functionality.json`. + +### graphql-test-common + +The `graphql-test-common` module provides utility methods shared across all test suites. Most test suites include this module as a dependency from the local repository. diff --git a/ballerina-tests/build.gradle b/ballerina-tests/build.gradle index 0d09c4712..e0ca15162 100644 --- a/ballerina-tests/build.gradle +++ b/ballerina-tests/build.gradle @@ -27,10 +27,21 @@ def packageName = "graphql" def packageOrg = "ballerina" def tomlVersion = stripBallerinaExtensionVersion("${project.version}") def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/BallerinaTest.toml") -def ballerinaTomlFile = new File("$project.projectDir/Ballerina.toml") +def testCommonTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/BallerinaTestCommon.toml") def ballerinaDist = "${project.rootDir}/target/ballerina-runtime" def distributionBinPath = "${ballerinaDist}/bin" def testCoverageParam = "--code-coverage --coverage-format=xml --includes=io.ballerina.stdlib.graphql.*:ballerina.graphql*" +def testSuites = [ + "graphql-advanced-test-suite", + "graphql-client-test-suite", + "graphql-dataloader-test-suite", + "graphql-interceptor-test-suite", + "graphql-security-test-suite", + "graphql-service-test-suite", + "graphql-subgraph-test-suite", + "graphql-subscription-test-suite" +] +def testCommonPackage = "graphql-test-common" def stripBallerinaExtensionVersion(String extVersion) { if (extVersion.matches(project.ext.timestampedVersionRegex)) { @@ -47,20 +58,36 @@ def stripBallerinaExtensionVersion(String extVersion) { } task updateTomlFiles { - doLast { - def newBallerinaToml = ballerinaTomlFilePlaceHolder.text.replace("@toml.version@", tomlVersion) - ballerinaTomlFile.text = newBallerinaToml + doLast { + testSuites.each { testPackage -> + def ballerinaTomlFile = new File("${project.projectDir}/${testPackage}/Ballerina.toml") + def newBallerinaToml = ballerinaTomlFilePlaceHolder.text.replace("@project.version@", project.version) + newBallerinaToml = newBallerinaToml.replace("@toml.version@", tomlVersion) + newBallerinaToml = newBallerinaToml.replace("@test.common@", testCommonPackage.replaceAll("-", "_")) + newBallerinaToml = newBallerinaToml.replace("@package.name@", testPackage.replaceAll("-", "_")) + ballerinaTomlFile.text = newBallerinaToml + } } + def ballerinaTomlFile = new File("${project.projectDir}/${testCommonPackage}/Ballerina.toml") + def newBallerinaToml = testCommonTomlFilePlaceHolder.text.replace("@project.version@", project.version) + newBallerinaToml = newBallerinaToml.replace("@toml.version@", tomlVersion) + newBallerinaToml = newBallerinaToml.replace("@package.name@", testCommonPackage.replaceAll("-", "_")) + ballerinaTomlFile.text = newBallerinaToml } task commitTomlFiles { doLast { + def files = "${project.projectDir}/${testCommonPackage}/Ballerina.toml ${project.projectDir}/${testCommonPackage}/Dependencies.toml " + testSuites.each{ testPackage -> + files += "${project.projectDir}/${testPackage}/Ballerina.toml ${project.projectDir}/${testPackage}/Dependencies.toml " + } + project.exec { ignoreExitValue true if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "git commit -m \"[Automated] Update the native jar versions\" Ballerina.toml Dependencies.toml" + commandLine 'cmd', '/c', "git commit -m \"[Automated] Update the native jar versions\" ${files}" } else { - commandLine 'sh', '-c', "git commit -m '[Automated] Update the native jar versions' Ballerina.toml Dependencies.toml" + commandLine 'sh', '-c', "git commit -m '[Automated] Update the native jar versions' ${files}" } } } @@ -72,15 +99,14 @@ def debugParams = "" def balJavaDebugParam = "" def graalvmFlag = "" def testParams = "" +def skipTests = false task initializeVariables { if (project.hasProperty("groups")) { groupParams = "--groups ${project.findProperty('groups')}" } - // Temporarily disable subscription tests - disableGroups = "--disable-groups subscriptions " if (project.hasProperty("disable")) { - disableGroups += "${project.findProperty("disable")}" + disableGroups = "--disable-groups ${project.findProperty("disable")}" } if (project.hasProperty("debug")) { debugParams = "--debug ${project.findProperty("debug")}" @@ -99,24 +125,56 @@ task initializeVariables { } } else { testParams = "--skip-tests" + skipTests = true + } + } +} + +task publishTestCommonPackageToLocal { + dependsOn(":${packageName}-${packageOrg}:build") + dependsOn(updateTomlFiles) + doLast { + if (!skipTests) { + exec { + workingDir "${project.projectDir}/${testCommonPackage}" + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + commandLine 'cmd', '/c', "${distributionBinPath}/bal.bat pack && exit %%ERRORLEVEL%%" + } else { + commandLine 'sh', '-c', "${distributionBinPath}/bal pack" + } + } + exec { + workingDir "${project.projectDir}/${testCommonPackage}" + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + commandLine 'cmd', '/c', "${distributionBinPath}/bal.bat push --repository=local" + + " && exit %%ERRORLEVEL%%" + } else { + commandLine 'sh', '-c', "${distributionBinPath}/bal push --repository=local" + } + } } } } task ballerinaTest { + dependsOn(publishTestCommonPackageToLocal) dependsOn(":${packageName}-${packageOrg}:build") dependsOn(updateTomlFiles) dependsOn(initializeVariables) finalizedBy(commitTomlFiles) doLast { - exec { - workingDir project.projectDir - environment "JAVA_OPTS", "-DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true" - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine 'cmd', '/c', "${balJavaDebugParam} ${distributionBinPath}/bal.bat test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams} && exit %%ERRORLEVEL%%" - } else { - commandLine 'sh', '-c', "${balJavaDebugParam} ${distributionBinPath}/bal test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams}" + testSuites.each { testPackage -> + if (!skipTests) { + exec { + workingDir "${project.projectDir}/${testPackage}" + environment "JAVA_OPTS", "-DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true" + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + commandLine 'cmd', '/c', "${balJavaDebugParam} ${distributionBinPath}/bal.bat test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams} && exit %%ERRORLEVEL%%" + } else { + commandLine 'sh', '-c', "${balJavaDebugParam} ${distributionBinPath}/bal test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams}" + } + } } } } @@ -127,7 +185,21 @@ test { } clean { - delete("${projectDir}/target") + delete "${project.projectDir}/${testCommonPackage}/target" + + testSuites.each { testPackage -> + delete "${project.projectDir}/${testPackage}/target" + } +} + +task deleteDependencyTomlFile { + if (project.hasProperty("deleteDependencies")) { + delete "${project.projectDir}/${testCommonPackage}/Dependencies.toml" + + testSuites.each { testPackage -> + delete "${project.projectDir}/${testPackage}/Dependencies.toml" + } + } } build.dependsOn ":${packageName}-ballerina:build" diff --git a/ballerina-tests/graphql-advanced-test-suite/object_types.bal b/ballerina-tests/graphql-advanced-test-suite/object_types.bal new file mode 100644 index 000000000..34a5c358c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/object_types.bal @@ -0,0 +1,172 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +public type Device distinct service object { + isolated resource function get id() returns @graphql:ID int; + + @graphql:ResourceConfig { + complexity: 1 + } + isolated resource function get brand() returns string; + + isolated resource function get model() returns string; + + @graphql:ResourceConfig { + complexity: 4 + } + isolated resource function get price() returns float; +}; + +type Mobile Phone|Tablet; + +public isolated distinct service class Phone { + *Device; + + private final int id; + private final string brand; + private final string model; + private final float price; + private final OS os; + private final Device[] connectedDevices; + + isolated function init(int id, string brand, string model, float price, OS os) { + self.id = id; + self.brand = brand; + self.model = model; + self.price = price; + self.os = os; + } + + isolated resource function get id() returns @graphql:ID int => self.id; + + isolated resource function get brand() returns string => self.brand; + + isolated resource function get model() returns string => self.model; + + isolated resource function get price() returns float => self.price; + + isolated resource function get os() returns OS => self.os; +} + +public isolated distinct service class Laptop { + *Device; + + private final int id; + private final string brand; + private final string model; + private final float price; + private final string processor; + private final int ram; + + isolated function init(int id, string brand, string model, float price, string processor, int ram) { + self.id = id; + self.brand = brand; + self.model = model; + self.price = price; + self.processor = processor; + self.ram = ram; + } + + isolated resource function get id() returns @graphql:ID int => self.id; + + isolated resource function get brand() returns string => self.brand; + + isolated resource function get model() returns string => self.model; + + isolated resource function get price() returns float => self.price; + + isolated resource function get processor() returns string => self.processor; + + isolated resource function get ram() returns int => self.ram; +} + +public isolated distinct service class Tablet { + *Device; + + private final int id; + private final string brand; + private final string model; + private final float price; + private final boolean hasCellular; + + isolated function init(int id, string brand, string model, float price, boolean hasCellular) { + self.id = id; + self.brand = brand; + self.model = model; + self.price = price; + self.hasCellular = hasCellular; + } + + isolated resource function get id() returns @graphql:ID int => self.id; + + isolated resource function get brand() returns string => self.brand; + + isolated resource function get model() returns string => self.model; + + isolated resource function get price() returns float => self.price; + + isolated resource function get hasCellular() returns boolean => self.hasCellular; +} + +service class Rating { + private final RatingData data; + + isolated function init(RatingData data) { + self.data = data; + } + + isolated resource function get id() returns @graphql:ID int => self.data.id; + + @graphql:ResourceConfig { + complexity: 1 + } + isolated resource function get title() returns string => self.data.title; + + @graphql:ResourceConfig { + complexity: 1 + } + isolated resource function get stars() returns int => self.data.stars; + + isolated resource function get description() returns string => self.data.description; + + @graphql:ResourceConfig { + complexity: 10 + } + isolated resource function get author() returns DeviceUserProfile|error { + lock { + if profileTable.hasKey(self.data.authorId) { + return new DeviceUserProfile(profileTable.get(self.data.authorId)); + } + } + return error("Author not found"); + } +} + +service class DeviceUserProfile { + private final DeviceUserProfileData data; + + isolated function init(DeviceUserProfileData data) { + self.data = data; + } + + isolated resource function get id() returns @graphql:ID int => self.data.id; + + isolated resource function get name() returns string => self.data.name; + + isolated resource function get age() returns int => self.data.age; +} diff --git a/ballerina-tests/graphql-advanced-test-suite/records.bal b/ballerina-tests/graphql-advanced-test-suite/records.bal new file mode 100644 index 000000000..2778deebc --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/records.bal @@ -0,0 +1,42 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +type DeviceUserProfileData readonly & record {| + readonly int id; + string name; + int age; +|}; + +type RatingInput readonly & record {| + string title; + int stars; + string description; + int authorId; +|}; + +type RatingData readonly & record {| + readonly int id; + string title; + int stars; + string description; + int authorId; +|}; + +enum OS { + iOS, + Android, + Windows +} diff --git a/ballerina-tests/tests/27_context.bal b/ballerina-tests/graphql-advanced-test-suite/tests/01_context.bal similarity index 58% rename from ballerina-tests/tests/27_context.bal rename to ballerina-tests/graphql-advanced-test-suite/tests/01_context.bal index e9dbd7850..a30dcbdff 100644 --- a/ballerina-tests/tests/27_context.bal +++ b/ballerina-tests/graphql-advanced-test-suite/tests/01_context.bal @@ -15,20 +15,20 @@ // under the License. import ballerina/graphql; +import ballerina/graphql_test_common as common; import ballerina/http; import ballerina/test; -import ballerina/websocket; @test:Config { groups: ["context"] } function testSettingAttribute() returns error? { graphql:ContextInit contextInit = - isolated function (http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context context = new; - context.set("String", "Ballerina"); - return context; - }; + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("String", "Ballerina"); + return context; + }; http:Request request = new; http:RequestContext requestContext = new; graphql:Context context = check contextInit(requestContext, request); @@ -42,11 +42,11 @@ function testSettingAttribute() returns error? { } function testSettingAttributeTwice() returns error? { graphql:ContextInit contextInit = - isolated function (http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context context = new; - context.set("String", "Ballerina"); - return context; - }; + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("String", "Ballerina"); + return context; + }; http:Request request = new; http:RequestContext requestContext = new; graphql:Context context = check contextInit(requestContext, request); @@ -65,11 +65,11 @@ function testSettingAttributeTwice() returns error? { } function testSettingObjectValues() returns error? { graphql:ContextInit contextInit = - isolated function (http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context context = new; - context.set("HierarchicalServiceObject", new HierarchicalName()); - return context; - }; + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("HierarchicalServiceObject", new HierarchicalName()); + return context; + }; http:Request request = new; http:RequestContext requestContext = new; graphql:Context context = check contextInit(requestContext, request); @@ -80,12 +80,12 @@ function testSettingObjectValues() returns error? { groups: ["context"] } isolated function testContextWithHttpHeaderValues() returns error? { - string url = "http://localhost:9092/context"; + string url = "http://localhost:9090/context"; string document = "{ profile { name } }"; http:Request request = new; request.setHeader("scope", "admin"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { data: { profile: { @@ -93,37 +93,37 @@ isolated function testContextWithHttpHeaderValues() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithAdditionalParameters() returns error? { - string url = "http://localhost:9092/context"; - string document = string`{ name(name: "Jesse Pinkman") }`; + string url = "http://localhost:9090/context"; + string document = string `{ name(name: "Jesse Pinkman") }`; http:Request request = new; request.setHeader("scope", "admin"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { data: { name: "Jesse Pinkman" } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithHttpHeaderValuesWithInvalidScope() returns error? { - string url = "http://localhost:9092/context"; + string url = "http://localhost:9090/context"; string document = "{ profile { name } }"; http:Request request = new; request.setHeader("scope", "user"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { errors: [ { @@ -141,19 +141,19 @@ isolated function testContextWithHttpHeaderValuesWithInvalidScope() returns erro ], data: null }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithHttpHeaderValuesInRemoteFunction() returns error? { - string url = "http://localhost:9092/context"; + string url = "http://localhost:9090/context"; string document = "mutation { update { name } }"; http:Request request = new; request.setHeader("scope", "admin"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { data: { update: [ @@ -169,19 +169,19 @@ isolated function testContextWithHttpHeaderValuesInRemoteFunction() returns erro ] } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithHttpHeaderValuesInRemoteFunctionWithInvalidScope() returns error? { - string url = "http://localhost:9092/context"; + string url = "http://localhost:9090/context"; string document = "mutation { update { name } }"; http:Request request = new; request.setHeader("scope", "user"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { errors: [ { @@ -192,24 +192,24 @@ isolated function testContextWithHttpHeaderValuesInRemoteFunctionWithInvalidScop column: 12 } ], - path: [ "update", 1 ] + path: ["update", 1] } ], data: null }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testNullableArrayElementValuesWithError() returns error? { - string url = "http://localhost:9092/context"; + string url = "http://localhost:9090/context"; string document = "mutation { updateNullable { name } }"; http:Request request = new; request.setHeader("scope", "user"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { errors: [ { @@ -220,7 +220,7 @@ isolated function testNullableArrayElementValuesWithError() returns error? { column: 12 } ], - path: [ "updateNullable", 1 ] + path: ["updateNullable", 1] } ], data: { @@ -235,16 +235,16 @@ isolated function testNullableArrayElementValuesWithError() returns error? { ] } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithMissingAttribute() returns error? { - string url = "http://localhost:9092/context"; + string url = "http://localhost:9090/context"; string document = "mutation { update { name } }"; - json actualPayload = check getJsonPayloadFromService(url, document); + json actualPayload = check common:getJsonPayloadFromService(url, document); json expectedPayload = { errors: [ { @@ -252,19 +252,19 @@ isolated function testContextWithMissingAttribute() returns error? { } ] }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithAdditionalParametersInNestedObject() returns error? { - string url = "http://localhost:9092/context"; - string document = string`{ animal { call(sound: "Meow", count: 3) } }`; + string url = "http://localhost:9090/context"; + string document = string `{ animal { call(sound: "Meow", count: 3) } }`; http:Request request = new; request.setHeader("scope", "admin"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { data: { animal: { @@ -272,19 +272,19 @@ isolated function testContextWithAdditionalParametersInNestedObject() returns er } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["context"] } isolated function testContextWithAdditionalParametersInNestedObjectWithInvalidScope() returns error? { - string url = "http://localhost:9092/context"; - string document = string`{ animal { call(sound: "Meow", count: 3) } }`; + string url = "http://localhost:9090/context"; + string document = string `{ animal { call(sound: "Meow", count: 3) } }`; http:Request request = new; request.setHeader("scope", "user"); - request.setPayload({ query: document }); - json actualPayload = check getJsonPayloadFromRequest(url, request); + request.setPayload({query: document}); + json actualPayload = check common:getJsonPayloadFromRequest(url, request); json expectedPayload = { data: { animal: { @@ -292,51 +292,5 @@ isolated function testContextWithAdditionalParametersInNestedObjectWithInvalidSc } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["context", "subscriptions"] -} -isolated function testContextWithSubscriptions() returns error? { - string url = "ws://localhost:9092/context"; - string document = string `subscription { messages }`; - websocket:ClientConfiguration configs = { - customHeaders: { - "scope": "admin" - }, - subProtocols: [GRAPHQL_TRANSPORT_WS] - }; - websocket:Client wsClient = check new (url, configs); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: i}}; - check validateNextMessage(wsClient, expectedMsgPayload); - } -} - -@test:Config { - groups: ["context", "subscriptions"] -} -isolated function testContextWithInvalidScopeInSubscriptions() returns error? { - string url = "ws://localhost:9092/context"; - string document = string `subscription { messages }`; - websocket:ClientConfiguration configs = { - customHeaders: { - "scope": "user" - }, - subProtocols: [GRAPHQL_TRANSPORT_WS] - }; - websocket:Client wsClient = check new (url, configs); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - json expectedErrorPayload = [ - { - message: "You don't have permission to retrieve data", - locations: [{line: 1, column: 16}], - path: ["messages"] - } - ]; - check validateErrorMessage(wsClient, expectedErrorPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } diff --git a/ballerina-tests/tests/30_file_upload.bal b/ballerina-tests/graphql-advanced-test-suite/tests/02_file_upload.bal similarity index 81% rename from ballerina-tests/tests/30_file_upload.bal rename to ballerina-tests/graphql-advanced-test-suite/tests/02_file_upload.bal index 0563940cb..102f6a538 100644 --- a/ballerina-tests/tests/30_file_upload.bal +++ b/ballerina-tests/graphql-advanced-test-suite/tests/02_file_upload.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/http; import ballerina/io; import ballerina/mime; @@ -24,15 +25,15 @@ import ballerina/test; } function testSingleFileUpload() returns error? { - string document = string`mutation($file: Upload!){ singleFileUpload(file: $file) { fileName, mimeType, content } }`; - json variables = {"file": null} ; + string document = string `mutation($file: Upload!){ singleFileUpload(file: $file) { fileName, mimeType, content } }`; + json variables = {"file": null}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { "0": ["variables.file"]}; + json pathMap = {"0": ["variables.file"]}; mime:Entity operations = new; mime:ContentDisposition contentDisposition1 = new; @@ -61,27 +62,27 @@ function testSingleFileUpload() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); json actualPayload = check httpClient->post("/fileUpload", request); json receivedFileContent = check actualPayload.data.singleFileUpload.content; stream fileReadBlocksAsStream = check io:fileReadBlocksAsStream("./tests/resources/files/sample1.json"); - string contentFromSource = check getContentFromByteStream(fileReadBlocksAsStream); - assertJsonValuesWithOrder(receivedFileContent, contentFromSource); + string contentFromSource = check common:getContentFromByteStream(fileReadBlocksAsStream); + common:assertJsonValuesWithOrder(receivedFileContent, contentFromSource); } @test:Config { groups: ["file_upload"] } function testMultipleFileUpload() returns error? { - string document = string`mutation($fileList: [Upload!]!){ multipleFileUpload(files: $fileList) { fileName, content } }`; - json variables = {"fileList": [null, null, null]} ; + string document = string `mutation($fileList: [Upload!]!){ multipleFileUpload(files: $fileList) { fileName, content } }`; + json variables = {"fileList": [null, null, null]}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { + json pathMap = { "0": ["variables.fileList.0"], "1": ["variables.fileList.1"], "2": ["variables.fileList.2"] @@ -129,39 +130,39 @@ function testMultipleFileUpload() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); json actualPayload = check httpClient->post("/fileUpload", request); json recevedContents = check actualPayload.data.multipleFileUpload; - json receivedJsonFileContent = check ( recevedContents)[0].content; + json receivedJsonFileContent = check (recevedContents)[0].content; stream fileReadBlocksAsStream = check io:fileReadBlocksAsStream("./tests/resources/files/sample1.json"); - string jsonContentFromSource = check getContentFromByteStream(fileReadBlocksAsStream); - assertJsonValuesWithOrder(receivedJsonFileContent, jsonContentFromSource); + string jsonContentFromSource = check common:getContentFromByteStream(fileReadBlocksAsStream); + common:assertJsonValuesWithOrder(receivedJsonFileContent, jsonContentFromSource); - json receivedTxtFileContent = check ( recevedContents)[1].content; + json receivedTxtFileContent = check (recevedContents)[1].content; fileReadBlocksAsStream = check io:fileReadBlocksAsStream("./tests/resources/files/sample2.txt"); - string txtContentFromSource = check getContentFromByteStream(fileReadBlocksAsStream); - assertJsonValuesWithOrder(receivedTxtFileContent, txtContentFromSource); + string txtContentFromSource = check common:getContentFromByteStream(fileReadBlocksAsStream); + common:assertJsonValuesWithOrder(receivedTxtFileContent, txtContentFromSource); - json receivedXmlFileContent = check ( recevedContents)[2].content; + json receivedXmlFileContent = check (recevedContents)[2].content; fileReadBlocksAsStream = check io:fileReadBlocksAsStream("./tests/resources/files/sample3.xml"); - string xmlContentFromSource = check getContentFromByteStream(fileReadBlocksAsStream); - assertJsonValuesWithOrder(receivedXmlFileContent, xmlContentFromSource); + string xmlContentFromSource = check common:getContentFromByteStream(fileReadBlocksAsStream); + common:assertJsonValuesWithOrder(receivedXmlFileContent, xmlContentFromSource); } @test:Config { groups: ["file_upload"] } isolated function testUndefinedVariableWithMultipartRequest1() returns error? { - string document = string`mutation($files: [Upload!]!){ multipleFileUpload(files: $files) { fileName }}`; - json variables = {"files": [null]} ; + string document = string `mutation($files: [Upload!]!){ multipleFileUpload(files: $files) { fileName }}`; + json variables = {"files": [null]}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { + json pathMap = { "0": ["variables.files.1"] }; @@ -191,7 +192,7 @@ isolated function testUndefinedVariableWithMultipartRequest1() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); http:Response response = check httpClient->post("/fileUpload", request); int statusCode = response.statusCode; test:assertEquals(statusCode, 400); @@ -204,15 +205,15 @@ isolated function testUndefinedVariableWithMultipartRequest1() returns error? { groups: ["file_upload"] } isolated function testUndefinedVariableWithMultipartRequest2() returns error? { - string document = string`mutation($files: [Upload!]!){ multipleFileUpload(files: $files) { fileName }}`; - json variables = {"files": [null]} ; + string document = string `mutation($files: [Upload!]!){ multipleFileUpload(files: $files) { fileName }}`; + json variables = {"files": [null]}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { + json pathMap = { "0": ["files.1"] }; @@ -242,7 +243,7 @@ isolated function testUndefinedVariableWithMultipartRequest2() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); http:Response response = check httpClient->post("/fileUpload", request); int statusCode = response.statusCode; test:assertEquals(statusCode, 400); @@ -255,15 +256,15 @@ isolated function testUndefinedVariableWithMultipartRequest2() returns error? { groups: ["file_upload"] } isolated function testMissingContentInMultipartRequest() returns error? { - string document = string`mutation($files: [Upload!]!){ multipleFileUpload(files: $files) }`; - json variables = {"files": [null, null]} ; + string document = string `mutation($files: [Upload!]!){ multipleFileUpload(files: $files) }`; + json variables = {"files": [null, null]}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { + json pathMap = { "0": ["variables.files.0"] }; @@ -293,7 +294,7 @@ isolated function testMissingContentInMultipartRequest() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); http:Response response = check httpClient->post("/fileUpload", request); int statusCode = response.statusCode; test:assertEquals(statusCode, 400); @@ -306,15 +307,15 @@ isolated function testMissingContentInMultipartRequest() returns error? { groups: ["file_upload"] } isolated function testInvalidMapFieldInMultipartRequest() returns error? { - string document = string`mutation($files: [Upload!]!){ multipleFileUpload(files: $files) }`; - json variables = {"files": [null]} ; + string document = string `mutation($files: [Upload!]!){ multipleFileUpload(files: $files) }`; + json variables = {"files": [null]}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { + json pathMap = { "0": "variables.files.0" }; @@ -344,7 +345,7 @@ isolated function testInvalidMapFieldInMultipartRequest() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); http:Response response = check httpClient->post("/fileUpload", request); int statusCode = response.statusCode; test:assertEquals(statusCode, 400); @@ -357,15 +358,15 @@ isolated function testInvalidMapFieldInMultipartRequest() returns error? { groups: ["file_upload"] } isolated function testInvalidMapTypeInMultipartRequest() returns error? { - string document = string`mutation($files: [Upload!]!){ multipleFileUpload(files: $files) }`; - json variables = {"files": [null]} ; + string document = string `mutation($files: [Upload!]!){ multipleFileUpload(files: $files) }`; + json variables = {"files": [null]}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { + json pathMap = { "0": [2] }; @@ -395,7 +396,7 @@ isolated function testInvalidMapTypeInMultipartRequest() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); http:Response response = check httpClient->post("/fileUpload", request); int statusCode = response.statusCode; test:assertEquals(statusCode, 400); @@ -409,15 +410,15 @@ isolated function testInvalidMapTypeInMultipartRequest() returns error? { } function testNonNullVariableValueWithMutipartRequest() returns error? { - string document = string`mutation($file: Upload!){ singleFileUpload(file: $file) { fileName, mimeType, content } }`; - json variables = {"file": "file"} ; + string document = string `mutation($file: Upload!){ singleFileUpload(file: $file) { fileName, mimeType, content } }`; + json variables = {"file": "file"}; json operation = { - "query":document, + "query": document, "variables": variables }; - json pathMap = { "0": ["variables.file"]}; + json pathMap = {"0": ["variables.file"]}; mime:Entity operations = new; mime:ContentDisposition contentDisposition1 = new; @@ -446,7 +447,7 @@ function testNonNullVariableValueWithMutipartRequest() returns error? { http:Request request = new; request.setBodyParts(bodyParts, contentType = mime:MULTIPART_FORM_DATA); - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9090", httpVersion = "1.1"); http:Response response = check httpClient->post("/fileUpload", request); int statusCode = response.statusCode; test:assertEquals(statusCode, 400); diff --git a/ballerina-tests/tests/39_field_object.bal b/ballerina-tests/graphql-advanced-test-suite/tests/03_field_object.bal similarity index 74% rename from ballerina-tests/tests/39_field_object.bal rename to ballerina-tests/graphql-advanced-test-suite/tests/03_field_object.bal index b646ad5cb..ada673861 100644 --- a/ballerina-tests/tests/39_field_object.bal +++ b/ballerina-tests/graphql-advanced-test-suite/tests/03_field_object.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,16 +22,16 @@ import ballerina/test; dataProvider: dataProviderFieldObject } function testFieldObject(string url, string documentFileName, string jsonFileName, string operationName) returns error? { - string document = check getGraphqlDocumentFromFile(documentFileName); - json actualPayload = check getJsonPayloadFromService(url, document, operationName = operationName); - json expectedPayload = check getJsonContentFromFile(jsonFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(documentFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, operationName = operationName); + json expectedPayload = check common:getJsonContentFromFile(jsonFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderFieldObject() returns string[][] { - string url1 = "localhost:9092/service_types"; - string url2 = "localhost:9092/service_objects"; + string url1 = "localhost:9090/service_types"; + string url2 = "localhost:9090/service_objects"; return [ [url1, "field_object", "field_object", "QueryName"], diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/04_constraint_validation.bal b/ballerina-tests/graphql-advanced-test-suite/tests/04_constraint_validation.bal new file mode 100644 index 000000000..1c787ad56 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/04_constraint_validation.bal @@ -0,0 +1,64 @@ +// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; + +@test:Config { + groups: ["constraints"], + dataProvider: dataProviderConstraintValidation +} +function testConstraintValidation(string url, string documentFileName, string jsonFileName, json variables = (), string? operationName = ()) returns error? { + string document = check common:getGraphqlDocumentFromFile(documentFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables = variables, operationName = operationName); + json expectedPayload = check common:getJsonContentFromFile(jsonFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +function dataProviderConstraintValidation() returns map<[string, string, string, json, string?]> { + + string url1 = "localhost:9090/constraints"; + string url2 = "localhost:9090/constraints_config"; + + json var1 = { + movie: { + name: "The Green Mile", + downloads: 12, + imdb: 1.0, + reviews: [] + } + }; + + json var2 = { + movies: [ + {name: "", downloads: 1, imdb: 0.5, reviews: []}, + {name: "The Shawshank Redemption", downloads: 22, imdb: 9.2, reviews: [null]}, + {name: "Inception", downloads: 3, imdb: 8.7, reviews: [null]} + ] + }; + + map<[string, string, string, json, string?]> dataSet = + { + "1": [url1, "constraints", "constraints", (), "A"], + "2": [url1, "constraints", "constraints_with_mutation", (), "B"], + "3": [url1, "constraints", "constraints_with_intersection_types", (), "C"], + "4": [url1, "constraints", "constraints_with_list_type_inputs", (), "D"], + "5": [url1, "constraints", "constraints_with_variables_1", var1, "E"], + "6": [url1, "constraints", "constraints_with_variables_2", var2, "F"], + "7": [url2, "constraints", "constraints_configuration", (), "A"] + }; + return dataSet; +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/05_server_caches.bal b/ballerina-tests/graphql-advanced-test-suite/tests/05_server_caches.bal new file mode 100644 index 000000000..31d3eaa84 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/05_server_caches.bal @@ -0,0 +1,221 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/lang.runtime; +import ballerina/test; + +@test:Config { + groups: ["server_cache"], + dataProvider: dataProviderServerCache +} +isolated function testServerSideCache(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/server_cache"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } +} + +function dataProviderServerCache() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache", ["server_cache_1", "server_cache_2", "server_cache_3"], (), ["A", "B", "A"]], + "2": ["server_cache_eviction", ["server_cache_2", "server_cache_4"], (), ["B", "A"]], + "3": ["server_cache_with_records", ["server_cache_with_rec_1", "server_cache_with_rec_2", "server_cache_with_rec_1"], (), ["A", "B", "A"]], + "4": ["server_cache_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_1"], (), ["A", "B", "A"]], + "5": ["server_cache_eviction_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_3"], (), ["A", "B", "A"]], + "6": ["server_cache_with_arrays", ["server_cache_with_arrays_1", "server_cache_with_arrays_2", "server_cache_with_arrays_3"], (), ["A", "B", "A"]], + "7": ["server_cache_eviction_with_arrays", ["server_cache_with_arrays_1", "server_cache_with_arrays_2", "server_cache_with_arrays_4"], (), ["A", "B", "A"]], + "8": ["server_cache_with_union", ["server_cache_with_union_1", "server_cache_with_union_2", "server_cache_with_union_1"], (), ["A", "B", "A"]], + "9": ["server_cache_eviction_with_union", ["server_cache_with_union_1", "server_cache_with_union_3", "server_cache_with_union_4"], (), ["A", "B", "A"]], + "10": ["server_cache_with_errors", ["server_cache_with_errors_1", "server_cache_with_errors_2"], (), ["A", "B"]], + "11": ["server_cache_with_nullable_inputs", ["server_cache_with_nullable_inputs_1", "server_cache_with_nullable_inputs_2", "server_cache_with_nullable_inputs_1"], (), ["A", "B", "A"]], + "12": ["server_cache_eviction_with_nullable_inputs", ["server_cache_eviction_with_nullable_inputs_1", "server_cache_eviction_with_nullable_inputs_2", "server_cache_eviction_with_nullable_inputs_3"], (), ["A", "B", "A"]], + "13": ["server_cache_with_list_inputs", ["server_cache_eviction_with_list_inputs_1", "server_cache_eviction_with_list_inputs_2", "server_cache_eviction_with_list_inputs_1"], {"names": ["Enemy3"]}, ["A", "B", "A"]], + "14": ["server_cache_eviction_with_list_inputs", ["server_cache_eviction_with_list_inputs_1", "server_cache_eviction_with_list_inputs_2", "server_cache_eviction_with_list_inputs_3"], {"names": ["Enemy3"]}, ["A", "B", "A"]], + "15": ["server_cache_with_null_values", ["server_cache_with_null_values_1", "server_cache_with_null_values_2", "server_cache_with_null_values_3"], (), ["A", "B", "A"]], + "16": ["server_cache_with_input_object", ["server_cache_with_input_object_1", "server_cache_with_input_object_2", "server_cache_with_input_object_3"], (), ["A", "B", "A"]] + }; + return dataSet; +} + +@test:Config { + groups: ["server_cache"], + dataProvider: dataProviderServerCacheOperationalLevel +} +isolated function testServerSideCacheInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/server_cache_operations"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } +} + +function dataProviderServerCacheOperationalLevel() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache", ["server_cache_1", "server_cache_2", "server_cache_1"], (), ["A", "B", "A"]], + "2": ["server_cache_eviction", ["server_cache_2", "server_cache_4"], (), ["B", "A"]], + "3": ["server_cache_with_records_operations", ["server_cache_with_rec_1", "server_cache_with_rec_3", "server_cache_with_rec_1"], (), ["A", "B", "A"]], + "4": ["server_cache_with_records_eviction", ["server_cache_with_rec_1", "server_cache_with_rec_5", "server_cache_with_rec_4"], (), ["A", "B", "A"]], + "5": ["server_cache_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_1"], (), ["A", "B", "A"]], + "6": ["server_cache_eviction_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_3"], (), ["A", "B", "A"]], + "7": ["server_cache_with_arrays", ["server_cache_with_arrays_5", "server_cache_with_arrays_2", "server_cache_with_arrays_5"], (), ["A", "B", "A"]], + "8": ["server_cache_eviction_with_arrays", ["server_cache_with_arrays_7", "server_cache_with_arrays_2", "server_cache_with_arrays_6"], (), ["A", "B", "A"]], + "9": ["server_cache_with_unions_operational_level", ["server_cache_with_unions_1", "server_cache_with_unions_2", "server_cache_with_unions_1"], (), ["A", "B", "A"]], + "10": ["server_cache_with_unions_operational_level", ["server_cache_with_unions_1", "server_cache_with_unions_2", "server_cache_with_unions_3"], (), ["A", "C", "A"]], + "11": ["server_cache_eviction", ["server_cache_2", "server_cache_4", "server_cache_5", "server_cache_4"], (), ["B", "A", "C", "A"]], + "12": ["server_cache_with_inputs", ["server_cache_with_nullable_inputs_7", "server_cache_with_nullable_inputs_8"], (), ["B", "C"]], + "13": ["server_cache_with_inputs", ["server_cache_with_empty_input_1", "server_cache_with_empty_input_2"], (), ["B", "D"]], + "14": ["server_cache_with_partial_responses", ["server_cache_with_partial_reponses_1", "server_cache_with_partial_reponses_2", "server_cache_with_partial_reponses_1"], (), ["A", "B", "A"]], + "15": ["server_cache_with_partial_responses", ["server_cache_with_partial_reponses_1", "server_cache_with_partial_reponses_2", "server_cache_with_partial_reponses_3"], (), ["A", "C", "A"]], + "16": ["server_cache_with_errors_2", ["server_cache_with_errors_4", "server_cache_with_errors_5", "server_cache_with_errors_3"], (), ["A", "B", "A"]] + }; + return dataSet; +} + +@test:Config { + groups: ["server_cache"] +} +isolated function testServerSideCacheInOperationalLevelWithTTL() returns error? { + string url = "http://localhost:9090/server_cache_operations"; + string document = check common:getGraphqlDocumentFromFile("server_cache_operations_with_TTL"); + runtime:sleep(21); + + json actualPayload = check common:getJsonPayloadFromService(url, document, (), "A"); + json expectedPayload = check common:getJsonContentFromFile("server_cache_1"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "B"); + expectedPayload = check common:getJsonContentFromFile("server_cache_10"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "A"); + expectedPayload = check common:getJsonContentFromFile("server_cache_1"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + runtime:sleep(21); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "A"); + expectedPayload = check common:getJsonContentFromFile("server_cache_9"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["server_cache"] +} +isolated function testCachingRecordWithoutNonOptionalFields() returns error? { + string url = "http://localhost:9090/server_cache_records_with_non_optional"; + string document = check common:getGraphqlDocumentFromFile("server_cache_records_with_non_optional_fields_1"); + + json actualPayload = check common:getJsonPayloadFromService(url, document, (), "GetProfiles"); + json expectedPayload = check common:getJsonContentFromFile("server_cache_records_with_non_optional_fields_1"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + _ = check common:getJsonPayloadFromService(url, document, {enableEvict: false}, "RemoveProfiles"); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "GetProfiles"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + document = check common:getGraphqlDocumentFromFile("server_cache_records_with_non_optional_fields_2"); + actualPayload = check common:getJsonPayloadFromService(url, document, (), "GetProfiles"); + expectedPayload = check common:getJsonContentFromFile("server_cache_records_with_non_optional_fields_2"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + _ = check common:getJsonPayloadFromService(url, document, {enableEvict: true}, "RemoveProfiles"); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "GetProfiles"); + expectedPayload = check common:getJsonContentFromFile("server_cache_records_with_non_optional_fields_3"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["server_cache"] +} +isolated function testServerCacheEvictionWithTTL() returns error? { + string url = "http://localhost:9090/field_caching_with_ttl"; + string document = check common:getGraphqlDocumentFromFile("server_cache_fields_with_TTL"); + + json actualPayload = check common:getJsonPayloadFromService(url, document, (), "A"); + json expectedPayload = check common:getJsonContentFromFile("server_cache_eviction_with_TTL_1"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + actualPayload = check common:getJsonPayloadFromService(url, document, {"name": "Potter"}, "B"); + expectedPayload = check common:getJsonContentFromFile("server_cache_eviction_with_TTL_2"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "A"); + expectedPayload = check common:getJsonContentFromFile("server_cache_eviction_with_TTL_1"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + + runtime:sleep(11); + + actualPayload = check common:getJsonPayloadFromService(url, document, (), "A"); + expectedPayload = check common:getJsonContentFromFile("server_cache_eviction_with_TTL_3"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["server_cache", "records"], + dataProvider: dataProviderServerSideCacheWithDynamicResponse +} +isolated function testServerSideCacheWithDynamicResponse(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/dynamic_response"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } +} + +function dataProviderServerSideCacheWithDynamicResponse() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_1", "server_cache_with_dynamic_responses_2", "server_cache_with_dynamic_responses_3"], (), ["A", "B", "C"]], + "2": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_2", "server_cache_with_dynamic_responses_4", "server_cache_with_dynamic_responses_2"], (), ["B", "D", "B"]], + "3": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_3", "server_cache_with_dynamic_responses_4", "server_cache_with_dynamic_responses_3"], (), ["C", "D", "C"]], + "4": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_3", "server_cache_with_dynamic_responses_4", "server_cache_with_dynamic_responses_5"], (), ["C", "E", "C"]], + "5": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_6", "server_cache_with_dynamic_responses_7", "server_cache_with_dynamic_responses_8"], (), ["B", "F", "B"]] + }; + return dataSet; +} + +@test:Config { + groups: ["server_cache"], + dataProvider: dataProviderServerCacheWithListInput +} +isolated function testServerCacheWithListInput(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/cache_with_list_input"; + string document = check common:getGraphqlDocumentFromFile("server_cache_with_list_input"); + + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } +} + +function dataProviderServerCacheWithListInput() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache_with_list_input", ["server_cache_with_list_input_1", "server_cache_with_list_input_2", "server_cache_with_list_input_3", "server_cache_with_list_input_1"], (), ["A", "B", "G", "A"]], + "2": ["server_cache_with_list_input", ["server_cache_with_list_input_4", "server_cache_with_list_input_5", "server_cache_with_list_input_6", "server_cache_with_list_input_4"], (), ["D", "H", "E", "D"]], + "3": ["server_cache_with_list_input", ["server_cache_with_list_input_7", "server_cache_with_list_input_8", "server_cache_with_list_input_7"], (), ["F", "I", "F"]] + }; + return dataSet; +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/06_query_complexity.bal b/ballerina-tests/graphql-advanced-test-suite/tests/06_query_complexity.bal new file mode 100644 index 000000000..e85e1d088 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/06_query_complexity.bal @@ -0,0 +1,86 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; + +@test:Config { + groups: ["query_complexity"] +} +isolated function testValidComplexityQuery() returns error? { + string url = "http://localhost:9090/complexity"; + string document = check common:getGraphqlDocumentFromFile("valid_complexity_query"); + string resourceFileName = "valid_complexity_query"; + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["query_complexity"] +} +isolated function testInvalidComplexityQuery() returns error? { + string url = "http://localhost:9090/complexity"; + string document = check common:getGraphqlDocumentFromFile("invalid_complexity_query"); + string resourceFileName = "invalid_complexity_query"; + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["query_complexity"] +} +isolated function testPrimitiveTypeFieldComplexity() returns error? { + string url = "http://localhost:9090/complexity"; + string document = "{ greeting }"; + json expectedPayload = {"data": {"greeting": "Hello"}}; + json actualPayload = check common:getJsonPayloadFromService(url, document); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["query_complexity"] +} +isolated function testComplexityWithUnionTypes() returns error? { + string url = "http://localhost:9090/complexity"; + string document = check common:getGraphqlDocumentFromFile("complexity_with_union_types"); + json expectedPayload = check common:getJsonContentFromFile("complexity_with_union_types"); + json actualPayload = check common:getJsonPayloadFromService(url, document); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["query_complexity"] +} +isolated function testComplexityWithMutation() returns error? { + string url = "http://localhost:9090/complexity"; + string document = check common:getGraphqlDocumentFromFile("complexity_with_mutation"); + json expectedPayload = check common:getJsonContentFromFile("complexity_with_mutation"); + json actualPayload = check common:getJsonPayloadFromService(url, document); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["query_complexity", "introspection"] +} +isolated function testGraphqlPlaygroundIntrospectionQueryWithComplexityVaildation() returns error? { + string url = "http://localhost:9090/complexity"; + string document = check common:getGraphqlDocumentFromFile("graphql_playground_introspection_query"); + json expectedPayload = check common:getJsonContentFromFile("graphql_playground_introspection_query_with_complexity_validation"); + json actualPayload = check common:getJsonPayloadFromService(url, document); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/listeners.bal b/ballerina-tests/graphql-advanced-test-suite/tests/listeners.bal new file mode 100644 index 000000000..f094cfe5b --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/listeners.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener graphqlListener = new (9090); diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/object_types.bal b/ballerina-tests/graphql-advanced-test-suite/tests/object_types.bal new file mode 100644 index 000000000..eb55f4f58 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/object_types.bal @@ -0,0 +1,275 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +public distinct isolated service class HierarchicalName { + isolated resource function get name/first() returns string { + return "Sherlock"; + } + + isolated resource function get name/last() returns string { + return "Holmes"; + } +} + +public isolated distinct service class AnimalClass { + isolated resource function get call(graphql:Context context, string sound, int count) returns string { + var scope = context.get("scope"); + if scope is string && scope == "admin" { + string call = ""; + int i = 0; + while i < count { + call += string `${sound} `; + i += 1; + } + return call; + } else { + return sound; + } + } +} + +public isolated service class GeneralGreeting { + isolated resource function get generalGreeting() returns string { + return "Hello, world"; + } +} + +public isolated service class Profile { + isolated resource function get name() returns Name { + return new; + } +} + +public isolated service class Vehicle { + private final string id; + private final string name; + private final int? registeredYear; + + isolated function init(string id, string name, int? registeredYear = ()) { + self.id = id; + self.name = name; + self.registeredYear = registeredYear; + } + + isolated resource function get id() returns string { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } + + isolated resource function get registeredYear() returns int|error { + int? registeredYear = self.registeredYear; + if registeredYear == () { + return error("Registered Year is Not Found"); + } else { + return registeredYear; + } + } +} + +public type PeopleService StudentService|TeacherService; + +public distinct isolated service class StudentService { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } +} + +public distinct isolated service class TeacherService { + private final int id; + private string name; + private string subject; + + public isolated function init(int id, string name, string subject) { + self.id = id; + self.name = name; + self.subject = subject; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + isolated function setName(string name) { + lock { + self.name = name; + } + } + + isolated resource function get subject() returns string { + lock { + return self.subject; + } + } + + isolated function setSubject(string subject) { + lock { + self.subject = subject; + } + } + + isolated resource function get holidays() returns Weekday[] { + return [SATURDAY, SUNDAY]; + } + + isolated resource function get school() returns School { + return new School("CHEM"); + } +} + +public type HumanService FriendService|EnemyService; + +public isolated distinct service class FriendService { + private final string name; + private final int age; + private final boolean isMarried; + + public isolated function init(string name, int age, boolean isMarried) { + self.name = name; + self.age = age; + self.isMarried = isMarried; + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 180 + } + } + isolated resource function get name() returns string { + return self.name; + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 180 + } + } + isolated resource function get age() returns int { + return self.age; + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 180 + } + } + isolated resource function get isMarried() returns boolean { + return self.isMarried; + } +} + +public isolated distinct service class EnemyService { + private final string name; + private final int age; + private final boolean isMarried; + + public isolated function init(string name, int age, boolean isMarried) { + self.name = name; + self.age = age; + self.isMarried = isMarried; + } + + isolated resource function get name() returns string { + return self.name; + } + + isolated resource function get age() returns int { + return self.age; + } + + isolated resource function get isMarried() returns boolean { + return self.isMarried; + } +} + +public isolated distinct service class AssociateService { + private final string name; + private final string status; + + public isolated function init(string name, string status) { + self.name = name; + self.status = status; + } + + isolated resource function get name() returns string { + return self.name; + } + + isolated resource function get status() returns string { + return self.status; + } +} + +public type Relationship FriendService|AssociateService; + +public isolated service class Name { + isolated resource function get first() returns string { + return "Sherlock"; + } + + isolated resource function get last() returns string { + return "Holmes"; + } + + isolated resource function get surname() returns string|error { + return error("No surname found"); + } +} + +public distinct isolated service class School { + private string name; + + public isolated function init(string name) { + self.name = name; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + # Get the opening days of the school. + # + return - The set of the weekdays the school is open + # # Deprecated + # School is now online. + @deprecated + isolated resource function get openingDays() returns Weekday[] { + return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/records.bal b/ballerina-tests/graphql-advanced-test-suite/tests/records.bal new file mode 100644 index 000000000..36269269c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/records.bal @@ -0,0 +1,115 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +import ballerina/constraint; + +public type Person readonly & record { + string name; + int age?; + Address address; +}; + +public type Address readonly & record { + string number; + string street; + string city; +}; + +public type FileInfo record { + string fileName; + string mimeType; + string encoding; + string content; +}; + +public type MovieDetails record {| + @constraint:String { + minLength: 1, + maxLength: 10 + } + string name; + + @constraint:Int { + minValue: 18 + } + int downloads; + + @constraint:Float { + minValue: 1.5 + } + float imdb; + + @constraint:Array { + length: 1 + } + Reviews?[] reviews; +|}; + +public type Reviews readonly & record {| + @constraint:Array { + maxLength: 2 + } + string[] comments; + + @constraint:Int { + minValueExclusive: 0, + maxValueExclusive: 6 + } + int stars; +|}; + +type Friend record {| + readonly string name; + int age; + boolean isMarried; +|}; + +type Enemy record {| + readonly string name; + int age; + boolean isMarried; +|}; + +type Associate record {| + readonly string name; + string status; +|}; + +type EnemyInput record {| + readonly string name = "Enemy6"; + int age = 12; +|}; + +type ProfileInfo record {| + string name; + int age; + string contact; +|}; + +type User record {| + int id?; + string name?; + int age?; +|}; + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_mutation.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_mutation.graphql new file mode 100644 index 000000000..da47398e5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_mutation.graphql @@ -0,0 +1,15 @@ +mutation { + addReview( + input: { + title: "Great Product" + stars: 5 + description: "I love this product" + authorId: 1 + } + ) { + id + author { + name + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_union_types.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_union_types.graphql new file mode 100644 index 000000000..a0822b043 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/complexity_with_union_types.graphql @@ -0,0 +1,23 @@ +{ + m1: mobile(id: 3) { + ... on Phone { + brand + os + } + } + + m2: mobile(id: 15) { + ... on Tablet { + brand + hasCellular + } + } + + m3: mobile(id: 15) { + ... on Phone { + brand + os + price + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/constraints.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/constraints.graphql new file mode 100644 index 000000000..ebd6c100e --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/constraints.graphql @@ -0,0 +1,46 @@ +query A { + movie(movie: { name: "Interstellar", downloads: 12, imdb: 1.0, reviews: [] }) +} + +mutation B { + addMovie( + movie: { + name: "Spider-Man: Into the Spider-Verse" + downloads: 12 + imdb: 1.0 + reviews: [] + } + ) +} + +query C { + movies( + movies: [ + { name: "", downloads: 1, imdb: 0.5, reviews: [] } + { name: "Avengers: Endgame", downloads: 22, imdb: 0.6, reviews: [null] } + { + name: "The Lord of the Rings: The Return of the King" + downloads: 3 + imdb: 4.0 + reviews: [] + } + ] + ) +} + +query D { + reviewStars( + reviews: [ + { comments: ["Good", "Nice"], stars: 7 } + { comments: ["Good", "Nice", "Bad"], stars: 7 } + ] + ) +} + +query E($movie: MovieDetails!) { + movie(movie: $movie) +} + +query F($movies: [MovieDetails!]!) { + movies(movies: $movies) +} diff --git a/ballerina-tests/tests/resources/documents/field_object.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object.graphql similarity index 54% rename from ballerina-tests/tests/resources/documents/field_object.graphql rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object.graphql index 69e360f35..29f873996 100644 --- a/ballerina-tests/tests/resources/documents/field_object.graphql +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object.graphql @@ -1,23 +1,23 @@ query QueryName { - person { - name - } + person { + name + } } query QueryNameAndAge { - person { - name - age - } + person { + name + age + } } query QueryNameAndAgeWithFragments { - person { - ...PersonNameAndAge - } + person { + ...PersonNameAndAge + } } fragment PersonNameAndAge on Person { - name - age + name + age } diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object_parameter_order.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object_parameter_order.graphql new file mode 100644 index 000000000..d080749d4 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/field_object_parameter_order.graphql @@ -0,0 +1,12 @@ +query FieldObjectParameterOrder1 { + student(name: "Skinny Pete", id: 100) { + name + } +} + +query FieldObjectParameterOrder2 { + student(name: "Skinny Pete", id: 100) { + name + id + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql new file mode 100644 index 000000000..d17da75f3 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql @@ -0,0 +1,99 @@ +query IntrospectionQuery { + __schema { + queryType { + name + } + mutationType { + name + } + subscriptionType { + name + } + types { + ...FullType + } + directives { + name + description + locations + args { + ...InputValue + } + } + } +} + +fragment FullType on __Type { + kind + name + description + fields(includeDeprecated: true) { + name + description + args { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + description + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } +} + +fragment InputValue on __InputValue { + name + description + type { + ...TypeRef + } + defaultValue +} + +fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/invalid_complexity_query.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/invalid_complexity_query.graphql new file mode 100644 index 000000000..22e5867e6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/invalid_complexity_query.graphql @@ -0,0 +1,25 @@ +query ComplexQuery { + d1: device(id: 2) { + ...DeviceFragment + ... on Phone { + os + } + } + d2: device(id: 12) { + ...DeviceFragment + ... on Laptop { + processor + } + } + d3: device(id: 22) { + ...DeviceFragment + ... on Tablet { + hasCellular + } + } +} + +fragment DeviceFragment on Device { + brand + model +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache.graphql new file mode 100644 index 000000000..69d33ccad --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache.graphql @@ -0,0 +1,8 @@ +query A { + greet + name(id: 1) +} + +mutation B { + updateName(name: "John", enableEvict: false) +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction.graphql new file mode 100644 index 000000000..b2dcdaa2f --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction.graphql @@ -0,0 +1,12 @@ +query A { + greet + name(id: 1) +} + +mutation B { + updateName(name: "John", enableEvict: true) +} + +mutation C { + updateName(name: "Walter White", enableEvict: false) +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_arrays.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_arrays.graphql new file mode 100644 index 000000000..f0123800b --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_arrays.graphql @@ -0,0 +1,13 @@ +query A { + getFriendServices { + name + age + } +} + +mutation B { + updateFriend(name: "Tyler", age: 28, isMarried: true, enableEvict: true) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql new file mode 100644 index 000000000..26b490f1a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql @@ -0,0 +1,10 @@ +query A($names: [String!]!) { + isAllMarried(names: $names) +} + +mutation B { + updateEnemy(enemy: { name: "Enemy3", age: 44 }, enableEvict: true) { + name + isMarried + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql new file mode 100644 index 000000000..c7be63981 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql @@ -0,0 +1,13 @@ +query A { + enemies(isMarried: null) { + name + isMarried + } +} + +mutation B { + removeEnemy(name: "Enemy2", enableEvict: false) { + name + isMarried + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_service_obj.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_service_obj.graphql new file mode 100644 index 000000000..589e25b60 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_service_obj.graphql @@ -0,0 +1,18 @@ +query A { + getFriendService(name: "Jesse Pinkman") { + name + age + } +} + +mutation B { + updateFriend( + name: "Jesse Pinkman" + age: 30 + isMarried: false + enableEvict: true + ) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_union.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_union.graphql new file mode 100644 index 000000000..2f54b8162 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_eviction_with_union.graphql @@ -0,0 +1,15 @@ +query A { + getServices(isEnemy: true) { + ... on EnemyService { + name + age + } + } +} + +mutation B { + addEnemy(name: "Jake", age: 22, isMarried: false, enableEvict: true) { + name + age + } +} diff --git a/ballerina-tests/tests/resources/documents/server_cache_fields_with_TTL.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_fields_with_TTL.graphql similarity index 51% rename from ballerina-tests/tests/resources/documents/server_cache_fields_with_TTL.graphql rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_fields_with_TTL.graphql index 613ba4736..0fbf3dd6c 100644 --- a/ballerina-tests/tests/resources/documents/server_cache_fields_with_TTL.graphql +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_fields_with_TTL.graphql @@ -1,7 +1,7 @@ query A { - friend + friend } mutation B($name: String!) { - updateFriend(name: $name) + updateFriend(name: $name) } diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_operations_with_TTL.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_operations_with_TTL.graphql new file mode 100644 index 000000000..12bfa9614 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_operations_with_TTL.graphql @@ -0,0 +1,8 @@ +query A { + greet + name(id: 1) +} + +mutation B { + updateName(name: "Heisenberg", enableEvict: false) +} diff --git a/ballerina-tests/tests/resources/documents/server_cache_records_with_non_optional_fields_1.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_records_with_non_optional_fields_1.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/server_cache_records_with_non_optional_fields_1.graphql rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_records_with_non_optional_fields_1.graphql diff --git a/ballerina-tests/tests/resources/documents/server_cache_records_with_non_optional_fields_2.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_records_with_non_optional_fields_2.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/server_cache_records_with_non_optional_fields_2.graphql rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_records_with_non_optional_fields_2.graphql diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_arrays.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_arrays.graphql new file mode 100644 index 000000000..e28c93376 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_arrays.graphql @@ -0,0 +1,13 @@ +query A { + getFriendServices { + name + age + } +} + +mutation B { + updateFriend(name: "Tyler", age: 28, isMarried: true, enableEvict: false) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_dynamic_responses.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_dynamic_responses.graphql new file mode 100644 index 000000000..7f922cff0 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_dynamic_responses.graphql @@ -0,0 +1,44 @@ +query A { + user(id: 1) { + id + } +} + +query B { + user(id: 1) { + id + name + } +} + +query C { + user(id: 1) { + id + name + age + } +} + +mutation D { + updateUser(id: 1, name: "White", age: 45, enableEvict: false) { + id + name + age + } +} + +mutation E { + updateUser(id: 1, name: "White", age: 45, enableEvict: true) { + id + name + age + } +} + +mutation F { + updateUser(id: 1, name: "Walter", age: 45, enableEvict: true) { + id + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors.graphql new file mode 100644 index 000000000..a2cad62a1 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors.graphql @@ -0,0 +1,7 @@ +query A { + isAdult(age: null) +} + +query B { + isAdult(age: 1) +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors_2.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors_2.graphql new file mode 100644 index 000000000..a2f11d962 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_errors_2.graphql @@ -0,0 +1,18 @@ +query A { + getFriendService(name: "Lalo Salamanca") { + name + age + } +} + +mutation B { + addFriend( + name: "Lalo Salamanca" + age: 44 + isMarried: false + enableEvict: false + ) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_input_object.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_input_object.graphql new file mode 100644 index 000000000..1802440e1 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_input_object.graphql @@ -0,0 +1,12 @@ +query A { + searchEnemy(enemyInput: { name: "Enemy6", age: 14 }) { + name + age + } +} + +mutation B { + removeEnemy(name: "Enemy6", enableEvict: false) { + name + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_inputs.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_inputs.graphql new file mode 100644 index 000000000..275c9e841 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_inputs.graphql @@ -0,0 +1,25 @@ +query A { + status(associates: null) +} + +query B { + status( + associates: [ + { name: "Gus Fring", status: "dead" } + { name: "Saul Goodman", status: "alive" } + ] + ) +} + +query C { + status( + associates: [ + { name: "Gus Fring", status: "alive" } + { name: "Saul Goodman", status: "alive" } + ] + ) +} + +query D { + status(associates: []) +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_input.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_input.graphql new file mode 100644 index 000000000..ea64b788f --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_input.graphql @@ -0,0 +1,63 @@ +query A { + users1(ids: [1]) { + id + name + age + } +} + +query B { + users1(ids: [2]) { + id + name + age + } +} + +query C { + users1(ids: [3]) { + id + name + age + } +} + +query D { + users2(ids: [[1], [3], [2]]) { + id + name + age + } +} + +query E { + users2(ids: [[1], [2], [3]]) { + id + name + age + } +} + +query F { + cities(addresses: [{ number: "1", street: "Main St", city: "London" }]) +} + +mutation G { + updateUser(id: 1, name: "Shane", age: 30) { + id + name + age + } +} + +mutation H { + updateUser(id: 1, name: "Rock", age: 22) { + id + name + age + } +} + +query I { + cities(addresses: [{ number: "2", street: "Main St", city: "london" }]) +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_inputs.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_inputs.graphql new file mode 100644 index 000000000..048833969 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_list_inputs.graphql @@ -0,0 +1,10 @@ +query A($names: [String!]!) { + isAllMarried(names: $names) +} + +mutation B { + updateEnemy(enemy: { name: "Enemy3", age: 44 }, enableEvict: false) { + name + isMarried + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_null_values.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_null_values.graphql new file mode 100644 index 000000000..d6f4d5fed --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_null_values.graphql @@ -0,0 +1,12 @@ +query A { + searchEnemy(enemyInput: {}) { + name + age + } +} + +mutation B { + addEnemy2(name: "Enemy6", age: 12, isMarried: false, enableEvict: false) { + name + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_nullable_inputs.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_nullable_inputs.graphql new file mode 100644 index 000000000..34ed828f1 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_nullable_inputs.graphql @@ -0,0 +1,13 @@ +query A { + enemies { + name + isMarried + } +} + +mutation B { + removeEnemy(name: "Enemy1", enableEvict: false) { + name + isMarried + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_partial_responses.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_partial_responses.graphql new file mode 100644 index 000000000..78b999aee --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_partial_responses.graphql @@ -0,0 +1,27 @@ +query A { + getFriendService(name: "Jesse Pinkman") { + age + } +} + +mutation B { + updateFriend( + name: "Jesse Pinkman" + age: 45 + isMarried: false + enableEvict: false + ) { + age + } +} + +mutation C { + updateFriend( + name: "Jesse Pinkman" + age: 45 + isMarried: false + enableEvict: true + ) { + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records.graphql new file mode 100644 index 000000000..3c9dfe11c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records.graphql @@ -0,0 +1,13 @@ +query A { + friends(isMarried: true) { + name + age + } +} + +mutation B { + addFriend(name: "John", age: 30, isMarried: true) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_eviction.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_eviction.graphql new file mode 100644 index 000000000..869b75400 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_eviction.graphql @@ -0,0 +1,18 @@ +query A { + friends(isMarried: true) { + name + age + } +} + +mutation B { + addFriend( + name: "Elliott Schwartz" + age: 51 + isMarried: true + enableEvict: true + ) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_operations.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_operations.graphql new file mode 100644 index 000000000..551bb0723 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_records_operations.graphql @@ -0,0 +1,18 @@ +query A { + friends(isMarried: true) { + name + age + } +} + +mutation B { + updateFriend( + name: "Walter White Jr." + age: 25 + isMarried: true + enableEvict: false + ) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_service_obj.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_service_obj.graphql new file mode 100644 index 000000000..56fca7371 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_service_obj.graphql @@ -0,0 +1,18 @@ +query A { + getFriendService(name: "Jesse Pinkman") { + name + age + } +} + +mutation B { + updateFriend( + name: "Jesse Pinkman" + age: 30 + isMarried: false + enableEvict: false + ) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_union.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_union.graphql new file mode 100644 index 000000000..192e07492 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_union.graphql @@ -0,0 +1,15 @@ +query A { + getServices(isEnemy: true) { + ... on EnemyService { + name + age + } + } +} + +mutation B { + addEnemy(name: "Gandalf", age: 68, isMarried: false, enableEvict: false) { + name + age + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_unions_operational_level.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_unions_operational_level.graphql new file mode 100644 index 000000000..feb70f892 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/server_cache_with_unions_operational_level.graphql @@ -0,0 +1,31 @@ +query A { + relationship(name: "Gus Fring") { + ...FriendFragment + ...AssociateFragment + } +} + +mutation B { + updateAssociate(name: "Gus Fring", status: "alive", enableEvict: false) { + name + status + } +} + +mutation C { + updateAssociate(name: "Gus Fring", status: "alive", enableEvict: true) { + name + status + } +} + +fragment FriendFragment on FriendService { + name + age + isMarried +} + +fragment AssociateFragment on AssociateService { + name + status +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/valid_complexity_query.graphql b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/valid_complexity_query.graphql new file mode 100644 index 000000000..5090fe9a6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/documents/valid_complexity_query.graphql @@ -0,0 +1,9 @@ +query SimpleQuery { + device(id: 2) { + brand + model + ... on Phone { + os + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_mutation.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_mutation.json new file mode 100644 index 000000000..44b8ba4a4 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_mutation.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "The operation exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 29", + "locations": [{ "line": 1, "column": 1 }] + } + ] +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_union_types.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_union_types.json new file mode 100644 index 000000000..44b8ba4a4 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/complexity_with_union_types.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "The operation exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 29", + "locations": [{ "line": 1, "column": 1 }] + } + ] +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints.json new file mode 100644 index 000000000..9a07410c5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Input validation failed in the field \"movie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", + "locations": [{ "line": 2, "column": 3 }], + "path": ["movie"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_configuration.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_configuration.json new file mode 100644 index 000000000..dd87a3bdb --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_configuration.json @@ -0,0 +1,5 @@ +{ + "data": { + "movie": "Interstellar" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_intersection_types.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_intersection_types.json new file mode 100644 index 000000000..021f07a31 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_intersection_types.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Input validation failed in the field \"movies\": Validation failed for '$[0].downloads:minValue','$[0].imdb:minValue','$[0].name:minLength','$[0].reviews:length','$[1].imdb:minValue','$[1].name:maxLength','$[2].downloads:minValue','$[2].name:maxLength','$[2].reviews:length' constraint(s).", + "locations": [{ "line": 17, "column": 3 }], + "path": ["movies"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_list_type_inputs.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_list_type_inputs.json new file mode 100644 index 000000000..f8b74d2fb --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_list_type_inputs.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Input validation failed in the field \"reviewStars\": Validation failed for '$[0].stars:maxValueExclusive','$[1].comments:maxLength','$[1].stars:maxValueExclusive' constraint(s).", + "locations": [{ "line": 32, "column": 3 }], + "path": ["reviewStars"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_mutation.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_mutation.json new file mode 100644 index 000000000..1d8bbd507 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_mutation.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Input validation failed in the field \"addMovie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", + "locations": [{ "line": 6, "column": 3 }], + "path": ["addMovie"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_1.json new file mode 100644 index 000000000..c8e91a0ea --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_1.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Input validation failed in the field \"movie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", + "locations": [{ "line": 41, "column": 3 }], + "path": ["movie"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_2.json new file mode 100644 index 000000000..66951897a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/constraints_with_variables_2.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Input validation failed in the field \"movies\": Validation failed for '$[0].downloads:minValue','$[0].imdb:minValue','$[0].name:minLength','$[0].reviews:length','$[1].name:maxLength','$[2].downloads:minValue' constraint(s).", + "locations": [{ "line": 45, "column": 3 }], + "path": ["movies"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object.json new file mode 100644 index 000000000..2ebecef69 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object.json @@ -0,0 +1,7 @@ +{ + "data": { + "person": { + "name": "Sherlock Holmes" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order1.json new file mode 100644 index 000000000..936dce1b9 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order1.json @@ -0,0 +1,7 @@ +{ + "data": { + "student": { + "name": "Jesse Pinkman" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order2.json new file mode 100644 index 000000000..4610d5ea7 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_parameter_order2.json @@ -0,0 +1,8 @@ +{ + "data": { + "student": { + "name": "Skinny Pete", + "id": 100 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_with_multiple_args.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_with_multiple_args.json new file mode 100644 index 000000000..2b97565fb --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/field_object_with_multiple_args.json @@ -0,0 +1,8 @@ +{ + "data": { + "person": { + "name": "Walter White", + "age": 50 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json new file mode 100644 index 000000000..6cbe6a6e2 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "The operation IntrospectionQuery exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 50", + "locations": [{ "line": 1, "column": 1 }] + } + ] +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/invalid_complexity_query.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/invalid_complexity_query.json new file mode 100644 index 000000000..be1ac1933 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/invalid_complexity_query.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "The operation ComplexQuery exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 48", + "locations": [{ "line": 1, "column": 1 }] + } + ] +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_1.json new file mode 100644 index 000000000..8396bcf20 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_1.json @@ -0,0 +1,6 @@ +{ + "data": { + "greet": "Hello, Walter White", + "name": "Walter White" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_10.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_10.json new file mode 100644 index 000000000..15a7d07bc --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_10.json @@ -0,0 +1,5 @@ +{ + "data": { + "updateName": "Heisenberg" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_2.json new file mode 100644 index 000000000..8ea44d264 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "updateName": "John" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_3.json new file mode 100644 index 000000000..5f77ff7d5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_3.json @@ -0,0 +1,6 @@ +{ + "data": { + "greet": "Hello, John", + "name": "Walter White" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_4.json new file mode 100644 index 000000000..0688e5830 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_4.json @@ -0,0 +1,6 @@ +{ + "data": { + "greet": "Hello, John", + "name": "John" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_5.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_5.json new file mode 100644 index 000000000..11194d105 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_5.json @@ -0,0 +1,5 @@ +{ + "data": { + "updateName": "Walter White" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_9.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_9.json new file mode 100644 index 000000000..0e33816e7 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_9.json @@ -0,0 +1,6 @@ +{ + "data": { + "greet": "Hello, Heisenberg", + "name": "Heisenberg" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json new file mode 100644 index 000000000..affb2c48c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "friend": "Harry" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json new file mode 100644 index 000000000..75125064c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "updateFriend": "Potter" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json new file mode 100644 index 000000000..4f92d54a6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json @@ -0,0 +1,5 @@ +{ + "data": { + "friend": "Potter" + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json new file mode 100644 index 000000000..cda6b099b --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "isAllMarried": false + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json new file mode 100644 index 000000000..6d07a8db5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "updateEnemy": { + "name": "Enemy3", + "isMarried": true + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json new file mode 100644 index 000000000..f089f2ef0 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json @@ -0,0 +1,5 @@ +{ + "data": { + "isAllMarried": true + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json new file mode 100644 index 000000000..4164f2389 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json @@ -0,0 +1,8 @@ +{ + "data": { + "enemies": [ + { "name": "Enemy2", "isMarried": true }, + { "name": "Enemy3", "isMarried": false } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json new file mode 100644 index 000000000..6e4eb47b7 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "removeEnemy": { + "name": "Enemy2", + "isMarried": true + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json new file mode 100644 index 000000000..4164f2389 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "enemies": [ + { "name": "Enemy2", "isMarried": true }, + { "name": "Enemy3", "isMarried": false } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json new file mode 100644 index 000000000..c0faa1ee9 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "profiles": [{ "name": "John" }, { "name": "Doe" }, { "name": "Jane" }] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json new file mode 100644 index 000000000..1a367f8ec --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json @@ -0,0 +1,9 @@ +{ + "data": { + "profiles": [ + { "name": "John", "age": 30 }, + { "name": "Doe", "age": 25 }, + { "name": "Jane", "age": 35 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json new file mode 100644 index 000000000..32c103be6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json @@ -0,0 +1,5 @@ +{ + "data": { + "profiles": [] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_1.json new file mode 100644 index 000000000..a09e53835 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_1.json @@ -0,0 +1,10 @@ +{ + "data": { + "getFriendServices": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 57 }, + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "John", "age": 30 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_2.json new file mode 100644 index 000000000..816b7312d --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "updateFriend": { + "name": "Tyler", + "age": 28 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_3.json new file mode 100644 index 000000000..a09e53835 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_3.json @@ -0,0 +1,10 @@ +{ + "data": { + "getFriendServices": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 57 }, + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "John", "age": 30 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_4.json new file mode 100644 index 000000000..ef8a0cf0d --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_4.json @@ -0,0 +1,11 @@ +{ + "data": { + "getFriendServices": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 57 }, + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "John", "age": 30 }, + { "name": "Tyler", "age": 28 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_5.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_5.json new file mode 100644 index 000000000..4d880462a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_5.json @@ -0,0 +1,10 @@ +{ + "data": { + "getFriendServices": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 25 }, + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "Elliott Schwartz", "age": 51 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_6.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_6.json new file mode 100644 index 000000000..1a70d6789 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_6.json @@ -0,0 +1,11 @@ +{ + "data": { + "getFriendServices": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 25 }, + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "Elliott Schwartz", "age": 51 }, + { "name": "Tyler", "age": 28 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_7.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_7.json new file mode 100644 index 000000000..4d880462a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_arrays_7.json @@ -0,0 +1,10 @@ +{ + "data": { + "getFriendServices": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 25 }, + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "Elliott Schwartz", "age": 51 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json new file mode 100644 index 000000000..79eb6d6a5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json @@ -0,0 +1,7 @@ +{ + "data": { + "user": { + "id": 1 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json new file mode 100644 index 000000000..7b080ce88 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "user": { + "id": 1, + "name": "John" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json new file mode 100644 index 000000000..74cf4d5a8 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json @@ -0,0 +1,9 @@ +{ + "data": { + "user": { + "id": 1, + "name": "John", + "age": 25 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json new file mode 100644 index 000000000..b579eb350 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json @@ -0,0 +1,9 @@ +{ + "data": { + "updateUser": { + "id": 1, + "name": "White", + "age": 45 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json new file mode 100644 index 000000000..0c55fb4ca --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json @@ -0,0 +1,9 @@ +{ + "data": { + "user": { + "id": 1, + "name": "White", + "age": 45 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json new file mode 100644 index 000000000..744e05c6f --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json @@ -0,0 +1,8 @@ +{ + "data": { + "user": { + "id": 1, + "name": "White" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json new file mode 100644 index 000000000..ca6f12b5a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json @@ -0,0 +1,9 @@ +{ + "data": { + "updateUser": { + "id": 1, + "name": "Walter", + "age": 45 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json new file mode 100644 index 000000000..805cfd0e1 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json @@ -0,0 +1,8 @@ +{ + "data": { + "user": { + "id": 1, + "name": "Walter" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_1.json new file mode 100644 index 000000000..facd73be2 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "status": ["dead", "alive"] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_2.json new file mode 100644 index 000000000..c08b96d9c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_empty_input_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "status": [] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_1.json new file mode 100644 index 000000000..9c6cf8cc6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_1.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Invalid argument type", + "locations": [{ "line": 2, "column": 3 }], + "path": ["isAdult"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_2.json new file mode 100644 index 000000000..51b1cf0e5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "isAdult": false + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_3.json new file mode 100644 index 000000000..85eda3c88 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "getFriendService": { + "name": "Lalo Salamanca", + "age": 44 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_4.json new file mode 100644 index 000000000..1dea1ec13 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_4.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "No person found with the name: Lalo Salamanca", + "locations": [{ "line": 2, "column": 3 }], + "path": ["getFriendService"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_5.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_5.json new file mode 100644 index 000000000..6cf35e262 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_errors_5.json @@ -0,0 +1,8 @@ +{ + "data": { + "addFriend": { + "name": "Lalo Salamanca", + "age": 44 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_1.json new file mode 100644 index 000000000..21ace1b12 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_1.json @@ -0,0 +1,8 @@ +{ + "data": { + "searchEnemy": { + "name": "Enemy6", + "age": 12 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_2.json new file mode 100644 index 000000000..e81806b66 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_2.json @@ -0,0 +1,7 @@ +{ + "data": { + "removeEnemy": { + "name": "Enemy6" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_3.json new file mode 100644 index 000000000..21ace1b12 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_input_object_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "searchEnemy": { + "name": "Enemy6", + "age": 12 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_1.json new file mode 100644 index 000000000..4478b22a3 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "users1": [{ "id": 1, "name": "John", "age": 25 }] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_2.json new file mode 100644 index 000000000..3d1feb65c --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "users1": [{ "id": 2, "name": "Jessie", "age": 17 }] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_3.json new file mode 100644 index 000000000..d501d3af6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_3.json @@ -0,0 +1,9 @@ +{ + "data": { + "updateUser": { + "id": 1, + "name": "Shane", + "age": 30 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_4.json new file mode 100644 index 000000000..eaa09fe24 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_4.json @@ -0,0 +1,5 @@ +{ + "data": { + "users2": [{ "id": 1, "name": "Shane", "age": 30 }] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_5.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_5.json new file mode 100644 index 000000000..dbd922cd5 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_5.json @@ -0,0 +1,9 @@ +{ + "data": { + "updateUser": { + "id": 1, + "name": "Rock", + "age": 22 + } + } +} diff --git a/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_6.json similarity index 54% rename from ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_6.json index 7325b8037..dde2ec676 100644 --- a/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_6.json @@ -1,5 +1,5 @@ { - "data": { - "convertDecimalToFloat": 2.0 - } + "data": { + "users2": [{ "id": 1, "name": "Rock", "age": 22 }] + } } diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_7.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_7.json new file mode 100644 index 000000000..0f93c1c4a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_7.json @@ -0,0 +1,5 @@ +{ + "data": { + "cities": ["London"] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_8.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_8.json new file mode 100644 index 000000000..e78c55ddc --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_list_input_8.json @@ -0,0 +1,5 @@ +{ + "data": { + "cities": ["London", "london"] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_1.json new file mode 100644 index 000000000..8781a0a9b --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "searchEnemy": null + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_2.json new file mode 100644 index 000000000..a57c4b773 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_2.json @@ -0,0 +1,7 @@ +{ + "data": { + "addEnemy2": { + "name": "Enemy6" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_3.json new file mode 100644 index 000000000..21ace1b12 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_null_values_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "searchEnemy": { + "name": "Enemy6", + "age": 12 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json new file mode 100644 index 000000000..071330708 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json @@ -0,0 +1,9 @@ +{ + "data": { + "enemies": [ + { "name": "Enemy1", "isMarried": false }, + { "name": "Enemy2", "isMarried": true }, + { "name": "Enemy3", "isMarried": false } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json new file mode 100644 index 000000000..5f4ae89a0 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "removeEnemy": { + "name": "Enemy1", + "isMarried": false + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json new file mode 100644 index 000000000..facd73be2 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json @@ -0,0 +1,5 @@ +{ + "data": { + "status": ["dead", "alive"] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json new file mode 100644 index 000000000..a195e3526 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json @@ -0,0 +1,5 @@ +{ + "data": { + "status": ["alive", "alive"] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_1.json new file mode 100644 index 000000000..97ce412cd --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_1.json @@ -0,0 +1,7 @@ +{ + "data": { + "getFriendService": { + "age": 30 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_2.json new file mode 100644 index 000000000..ec9913c43 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_2.json @@ -0,0 +1,7 @@ +{ + "data": { + "updateFriend": { + "age": 45 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_3.json new file mode 100644 index 000000000..9b2a28419 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_partial_reponses_3.json @@ -0,0 +1,7 @@ +{ + "data": { + "getFriendService": { + "age": 45 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_1.json new file mode 100644 index 000000000..9baafbca3 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_1.json @@ -0,0 +1,8 @@ +{ + "data": { + "friends": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 57 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_2.json new file mode 100644 index 000000000..dfcb34ed1 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "addFriend": { + "name": "John", + "age": 30 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_3.json new file mode 100644 index 000000000..be96dfcb1 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "updateFriend": { + "name": "Walter White Jr.", + "age": 25 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_4.json new file mode 100644 index 000000000..0967b1e2a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_4.json @@ -0,0 +1,9 @@ +{ + "data": { + "friends": [ + { "name": "Skyler", "age": 45 }, + { "name": "Walter White Jr.", "age": 25 }, + { "name": "Elliott Schwartz", "age": 51 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_5.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_5.json new file mode 100644 index 000000000..f1785dcc6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_rec_5.json @@ -0,0 +1,8 @@ +{ + "data": { + "addFriend": { + "name": "Elliott Schwartz", + "age": 51 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_1.json new file mode 100644 index 000000000..a19f6f4ba --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_1.json @@ -0,0 +1,8 @@ +{ + "data": { + "getFriendService": { + "name": "Jesse Pinkman", + "age": 23 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_2.json new file mode 100644 index 000000000..ce456161b --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "updateFriend": { + "name": "Jesse Pinkman", + "age": 30 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_3.json new file mode 100644 index 000000000..687f31d4d --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_svc_obj_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "getFriendService": { + "name": "Jesse Pinkman", + "age": 30 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_1.json new file mode 100644 index 000000000..dea2fb84f --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "getServices": [{ "name": "Jesse Pinkman", "age": 30 }] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_2.json new file mode 100644 index 000000000..37710f2f6 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "addEnemy": { + "name": "Gandalf", + "age": 68 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_3.json new file mode 100644 index 000000000..358081a16 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "addEnemy": { + "name": "Jake", + "age": 22 + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_4.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_4.json new file mode 100644 index 000000000..81d2cfe9a --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_union_4.json @@ -0,0 +1,9 @@ +{ + "data": { + "getServices": [ + { "name": "Jesse Pinkman", "age": 30 }, + { "name": "Gandalf", "age": 68 }, + { "name": "Jake", "age": 22 } + ] + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_1.json new file mode 100644 index 000000000..719fbec39 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_1.json @@ -0,0 +1,8 @@ +{ + "data": { + "relationship": { + "name": "Gus Fring", + "status": "dead" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_2.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_2.json new file mode 100644 index 000000000..5a5ae5c29 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_2.json @@ -0,0 +1,8 @@ +{ + "data": { + "updateAssociate": { + "name": "Gus Fring", + "status": "alive" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_3.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_3.json new file mode 100644 index 000000000..79234cb45 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/server_cache_with_unions_3.json @@ -0,0 +1,8 @@ +{ + "data": { + "relationship": { + "name": "Gus Fring", + "status": "alive" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/valid_complexity_query.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/valid_complexity_query.json new file mode 100644 index 000000000..2476ca7a3 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/expected_results/valid_complexity_query.json @@ -0,0 +1,9 @@ +{ + "data": { + "device": { + "brand": "Apple", + "model": "iPhone 15 Pro", + "os": "iOS" + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample1.json b/ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample1.json new file mode 100644 index 000000000..d12c90feb --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample1.json @@ -0,0 +1,3 @@ +{ + "data": "This is GraphQL File upload" +} diff --git a/ballerina-tests/tests/resources/files/sample2.txt b/ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample2.txt similarity index 100% rename from ballerina-tests/tests/resources/files/sample2.txt rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample2.txt diff --git a/ballerina-tests/tests/resources/files/sample3.xml b/ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample3.xml similarity index 100% rename from ballerina-tests/tests/resources/files/sample3.xml rename to ballerina-tests/graphql-advanced-test-suite/tests/resources/files/sample3.xml diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/services.bal b/ballerina-tests/graphql-advanced-test-suite/tests/services.bal new file mode 100644 index 000000000..95b65b1dc --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/services.bal @@ -0,0 +1,664 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/graphql_test_common as common; +import ballerina/http; + +@graphql:ServiceConfig { + contextInit: + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("scope", check request.getHeader("scope")); + return context; + } +} +service /context on graphqlListener { + isolated resource function get profile(graphql:Context context) returns Person|error { + var scope = check context.get("scope"); + if scope is string && scope == "admin" { + return { + name: "Walter White", + age: 51, + address: { + number: "308", + street: "Negra Arroyo Lane", + city: "Albuquerque" + } + }; + } else { + return error("You don't have permission to retrieve data"); + } + } + + isolated resource function get name(graphql:Context context, string name) returns string|error { + var scope = check context.get("scope"); + if scope is string && scope == "admin" { + return name; + } else { + return error("You don't have permission to retrieve data"); + } + } + + isolated resource function get animal() returns AnimalClass { + return new; + } + + remote function update(graphql:Context context) returns (Person|error)[]|error { + var scope = check context.get("scope"); + if scope is string && scope == "admin" { + return people; + } else { + return [p1, error("You don't have permission to retrieve data"), p3]; + } + } + + remote function updateNullable(graphql:Context context) returns (Person|error?)[]|error { + var scope = check context.get("scope"); + if scope is string && scope == "admin" { + return people; + } else { + return [p1, error("You don't have permission to retrieve data"), p3]; + } + } +} + +service /fileUpload on graphqlListener { + resource function get name() returns string { + return "/fileUpload"; + } + + remote function singleFileUpload(graphql:Upload file) returns FileInfo|error { + string contentFromByteStream = check common:getContentFromByteStream(file.byteStream); + return { + fileName: file.fileName, + mimeType: file.mimeType, + encoding: file.encoding, + content: contentFromByteStream + }; + } + + remote function multipleFileUpload(graphql:Upload[] files) returns FileInfo[]|error { + FileInfo[] fileInfo = []; + foreach int i in 0 ..< files.length() { + graphql:Upload file = files[i]; + string contentFromByteStream = check common:getContentFromByteStream(file.byteStream); + fileInfo.push({ + fileName: file.fileName, + mimeType: file.mimeType, + encoding: file.encoding, + content: contentFromByteStream + }); + } + return fileInfo; + } +} + +service /service_types on graphqlListener { + isolated resource function get person(graphql:Field 'field) returns Person { + string[] subfieldNames = 'field.getSubfieldNames(); + if subfieldNames == ["name"] { + return { + name: "Sherlock Holmes", + address: {number: "221/B", street: "Baker Street", city: "London"} + }; + } else if subfieldNames == ["name", "age"] { + return { + name: "Walter White", + age: 50, + address: {number: "309", street: "Negro Arroyo Lane", city: "Albuquerque"} + }; + } + return { + name: "Jesse Pinkman", + age: 25, + address: {number: "208", street: "Margo Street", city: "Albuquerque"} + }; + } +} + +service /service_objects on graphqlListener { + isolated resource function get student(string name, graphql:Context context, int id, + graphql:Field 'field) returns StudentService { + if context.get("scope") is error { + // ignore + } + if 'field.getSubfieldNames().indexOf("id") is int { + return new StudentService(id, name); + } + return new StudentService(10, "Jesse Pinkman"); + } +} + +service /constraints on graphqlListener { + private string[] movies; + + isolated function init() { + self.movies = []; + } + + isolated resource function get movie(MovieDetails movie) returns string { + return movie.name; + } + + isolated resource function get movies(MovieDetails[] & readonly movies) returns string[] { + return movies.map(m => m.name); + } + + isolated resource function get reviewStars(Reviews[] reviews) returns int[] { + return reviews.map(r => r.stars); + } + + isolated remote function addMovie(MovieDetails movie) returns string { + string name = movie.name; + self.movies.push(name); + return name; + } +} + +@graphql:ServiceConfig { + validation: false +} +service /constraints_config on graphqlListener { + isolated resource function get movie(MovieDetails movie) returns string { + return movie.name; + } +} + +service /server_cache on graphqlListener { + private string name = "Walter White"; + private table key(name) friends = table [ + {name: "Skyler", age: 45, isMarried: true}, + {name: "Walter White Jr.", age: 57, isMarried: true}, + {name: "Jesse Pinkman", age: 23, isMarried: false} + ]; + + private table key(name) enemies = table [ + {name: "Enemy1", age: 12, isMarried: false}, + {name: "Enemy2", age: 66, isMarried: true}, + {name: "Enemy3", age: 33, isMarried: false} + ]; + + isolated resource function get greet() returns string { + return "Hello, " + self.name; + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true + } + } + isolated resource function get isAdult(int? age) returns boolean|error { + if age is int { + return age >= 18 ? true : false; + } + return error("Invalid argument type"); + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true + } + } + isolated resource function get name(int id) returns string { + return self.name; + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 120 + } + } + isolated resource function get friends(boolean isMarried = false) returns Friend[] { + if isMarried { + return from Friend friend in self.friends + where friend.isMarried == true + select friend; + } + return from Friend friend in self.friends + where friend.isMarried == false + select friend; + } + + isolated resource function get getFriendService(string name) returns FriendService { + Friend[] person = from Friend friend in self.friends + where friend.name == name + select friend; + return new FriendService(person[0].name, person[0].age, person[0].isMarried); + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 180 + } + } + isolated resource function get getFriendServices() returns FriendService[] { + return from Friend friend in self.friends + select new FriendService(friend.name, friend.age, friend.isMarried); + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 180 + } + } + isolated resource function get getServices(boolean isEnemy) returns HumanService[] { + if isEnemy { + return from Friend friend in self.friends + where friend.isMarried == false + select new EnemyService(friend.name, friend.age, friend.isMarried); + } + return from Friend friend in self.friends + where friend.isMarried == true + select new FriendService(friend.name, friend.age, friend.isMarried); + } + + @graphql:ResourceConfig { + cacheConfig: { + maxAge: 120 + } + } + isolated resource function get enemies(boolean? isMarried = ()) returns Enemy[] { + if isMarried is () { + return from Enemy enemy in self.enemies + select enemy; + } + return from Enemy enemy in self.enemies + where enemy.isMarried == isMarried + select enemy; + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true + } + } + isolated resource function get isAllMarried(string[] names) returns boolean { + foreach string name in names { + if self.enemies.hasKey(name) && !self.enemies.get(name).isMarried { + return false; + } + } + return true; + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true + } + } + isolated resource function get searchEnemy(EnemyInput enemyInput) returns Enemy? { + if self.enemies.hasKey(enemyInput.name) { + return self.enemies.get(enemyInput.name); + } + return; + } + + isolated remote function updateName(graphql:Context context, string name, boolean enableEvict) returns string|error { + if enableEvict { + check context.invalidate("name"); + } + self.name = name; + return self.name; + } + + isolated remote function updateFriend(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns FriendService|error { + if enableEvict { + check context.invalidateAll(); + } + self.friends.put({name: name, age: age, isMarried: isMarried}); + return new FriendService(name, age, isMarried); + } + + isolated remote function addFriend(string name, int age, boolean isMarried) returns Friend { + Friend friend = {name: name, age: age, isMarried: isMarried}; + self.friends.add(friend); + return friend; + } + + isolated remote function addEnemy(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns Friend|error { + if enableEvict { + check context.invalidate("getServices"); + } + Friend friend = {name: name, age: age, isMarried: isMarried}; + self.friends.add(friend); + return friend; + } + + isolated remote function addEnemy2(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns Enemy|error { + if enableEvict { + check context.invalidate("enemies"); + } + Enemy enemy = {name: name, age: age, isMarried: isMarried}; + self.enemies.add(enemy); + return enemy; + } + + isolated remote function removeEnemy(graphql:Context context, string name, boolean enableEvict) returns Enemy|error { + if enableEvict { + check context.invalidate("enemies"); + } + return self.enemies.remove(name); + } + + isolated remote function updateEnemy(graphql:Context context, EnemyInput enemy, boolean enableEvict) returns Enemy|error { + if enableEvict { + check context.invalidateAll(); + } + Enemy enemyInput = {name: enemy.name, age: enemy.age, isMarried: true}; + self.enemies.put(enemyInput); + return enemyInput; + } +} + +@graphql:ServiceConfig { + cacheConfig: { + enabled: true, + maxAge: 20, + maxSize: 15 + } +} +service /server_cache_operations on graphqlListener { + private string name = "Walter White"; + private table key(name) friends = table [ + {name: "Skyler", age: 45, isMarried: true}, + {name: "Walter White Jr.", age: 57, isMarried: true}, + {name: "Jesse Pinkman", age: 23, isMarried: false} + ]; + + private table key(name) associates = table [ + {name: "Gus Fring", status: "dead"}, + {name: "Tuco Salamanca", status: "dead"}, + {name: "Saul Goodman", status: "alive"} + ]; + + isolated resource function get greet() returns string { + return "Hello, " + self.name; + } + + isolated resource function get name(int id) returns string { + return self.name; + } + + isolated resource function get friends(boolean isMarried = false) returns Friend[] { + if isMarried { + return from Friend friend in self.friends + where friend.isMarried == true + select friend; + } + return from Friend friend in self.friends + where friend.isMarried == false + select friend; + } + + isolated resource function get getFriendService(string name) returns FriendService|error { + Friend[] person = from Friend friend in self.friends + where friend.name == name + select friend; + if person != [] { + return new FriendService(person[0].name, person[0].age, person[0].isMarried); + } else { + return error(string `No person found with the name: ${name}`); + } + } + + isolated resource function get getAssociateService(string name) returns AssociateService { + Associate[] person = from Associate associate in self.associates + where associate.name == name + select associate; + return new AssociateService(person[0].name, person[0].status); + } + + isolated resource function get relationship(string name) returns Relationship { + (Associate|Friend)[] person = from Associate associate in self.associates + where associate.name == name + select associate; + if person.length() == 0 { + person = from Friend friend in self.friends + where friend.name == name + select friend; + return new FriendService(person[0].name, (person[0]).age, (person[0]).isMarried); + } + return new AssociateService(person[0].name, (person[0]).status); + } + + isolated resource function get getFriendServices() returns FriendService[] { + return from Friend friend in self.friends + select new FriendService(friend.name, friend.age, friend.isMarried); + } + + isolated resource function get getAllFriendServices(graphql:Context context, boolean enableEvict) returns FriendService[]|error { + if enableEvict { + check context.invalidateAll(); + } + return from Friend friend in self.friends + select new FriendService(friend.name, friend.age, friend.isMarried); + } + + isolated remote function updateName(graphql:Context context, string name, boolean enableEvict) returns string|error { + if enableEvict { + check context.invalidateAll(); + } + self.name = name; + return self.name; + } + + isolated remote function updateFriend(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns FriendService|error { + if enableEvict { + check context.invalidateAll(); + } + self.friends.put({name: name, age: age, isMarried: isMarried}); + return new FriendService(name, age, isMarried); + } + + isolated remote function updateAssociate(graphql:Context context, string name, string status, boolean enableEvict) returns AssociateService|error { + if enableEvict { + check context.invalidateAll(); + } + self.associates.put({name: name, status: status}); + return new AssociateService(name, status); + } + + isolated remote function addFriend(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns Friend|error { + if enableEvict { + check context.invalidate("getFriendService"); + check context.invalidate("getAllFriendServices"); + check context.invalidate("friends"); + } + Friend friend = {name: name, age: age, isMarried: isMarried}; + self.friends.add(friend); + return friend; + } + + resource function get status(Associate[]? associates) returns string[]? { + if associates is Associate[] { + return associates.map(associate => associate.status); + } + return; + } +} + +@graphql:ServiceConfig { + cacheConfig: { + maxSize: 5 + } +} +service /server_cache_records_with_non_optional on graphqlListener { + private table profiles = table [ + {name: "John", age: 30, contact: "0123456789"}, + {name: "Doe", age: 25, contact: "9876543210"}, + {name: "Jane", age: 35, contact: "1234567890"} + ]; + + resource function get profiles() returns ProfileInfo[] { + return self.profiles.toArray(); + } + + remote function removeProfiles(graphql:Context ctx, boolean enableEvict) returns ProfileInfo[]|error { + if enableEvict { + check ctx.invalidateAll(); + } + ProfileInfo[] profiles = self.profiles.toArray(); + self.profiles.removeAll(); + return profiles; + } +} + +service /field_caching_with_ttl on graphqlListener { + private string enemy = "voldemort"; + private string friend = "Harry"; + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true, + maxAge: 10 + } + } + resource function get friend() returns string { + return self.friend; + } + + remote function updateFriend(string name) returns string|error { + self.friend = name; + return self.friend; + } +} + +service /dynamic_response on graphqlListener { + private User user = {id: 1, name: "John", age: 25}; + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true, + maxAge: 600 + } + } + resource function get user(graphql:Field 'field, int id) returns User { + string[] sub = 'field.getSubfieldNames(); + if sub.length() == 1 { + return {id: self.user.id}; + } else if sub.length() == 2 { + return {id: self.user.id, name: self.user.name}; + } else { + return self.user; + } + } + + remote function updateUser(graphql:Context context, int id, string name, int age, boolean enableEvict) returns User|error { + if enableEvict { + check context.invalidate("user"); + } + self.user = {id: id, name: name, age: age}; + return self.user; + } +} + +@graphql:ServiceConfig { + cacheConfig: { + maxAge: 600 + } +} +service /cache_with_list_input on graphqlListener { + private User user1 = {id: 1, name: "John", age: 25}; + private User user2 = {id: 2, name: "Jessie", age: 17}; + private Address[] addresses = []; + + resource function get users1(int[] ids) returns User[] { + if ids.length() == 1 && ids[0] == 1 { + return [self.user1]; + } else if ids.length() == 1 && ids[0] == 2 { + return [self.user2]; + } + return [self.user1, self.user2]; + } + + resource function get users2(int[][] ids) returns User[] { + if ids.length() == 3 && ids[0][0] == 1 { + return [self.user1]; + } else if ids.length() == 3 && ids[0][0] == 2 || ids[0][0] == 3 { + return [self.user2]; + } + return [self.user1, self.user2]; + } + + resource function get cities(Address[] addresses) returns string[] { + self.addresses.push(...addresses); + return self.addresses.map(address => address.city); + } + + remote function updateUser(int id, string name, int age) returns User|error { + self.user1 = {id: id, name: name, age: age}; + return self.user1; + } + + remote function updateAddress(Address address) returns Address { + self.addresses.push(address); + return address; + } +} + +@graphql:ServiceConfig { + queryComplexityConfig: { + maxComplexity: 20, + defaultFieldComplexity: 2 + } +} +service /complexity on graphqlListener { + resource function get greeting() returns string { + return "Hello"; + } + + @graphql:ResourceConfig { + complexity: 10 + } + resource function get device(int id) returns Device { + if id < 10 { + return new Phone(id, "Apple", "iPhone 15 Pro", 1199.00, "iOS"); + } + + if id < 20 { + return new Laptop(id, "Apple", "MacBook Pro", 2399.00, "M1", 32); + } + + return new Tablet(id, "Samsung", "Galaxy Tab S7", 649.99, true); + } + + @graphql:ResourceConfig { + complexity: 5 + } + resource function get mobile(int id) returns Mobile { + if id < 10 { + return new Phone(id, "Apple", "iPhone 15 Pro", 1199.00, "iOS"); + } + + return new Tablet(id, "Samsung", "Galaxy Tab S7", 649.99, true); + } + + @graphql:ResourceConfig { + complexity: 15 + } + remote function addReview(RatingInput input) returns Rating { + lock { + int id = ratingTable.length(); + RatingData rating = { + id, + ...input + }; + ratingTable.put(rating); + return new (rating); + } + } +} diff --git a/ballerina-tests/graphql-advanced-test-suite/tests/values.bal b/ballerina-tests/graphql-advanced-test-suite/tests/values.bal new file mode 100644 index 000000000..b1cf0a20d --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/tests/values.bal @@ -0,0 +1,53 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +final readonly & Person p1 = { + name: "Sherlock Holmes", + age: 40, + address: a1 +}; + +final readonly & Person p2 = { + name: "Walter White", + age: 50, + address: a2 +}; + +final readonly & Person p3 = { + name: "Tom Marvolo Riddle", + age: 100, + address: a3 +}; + +final readonly & Address a1 = { + number: "221/B", + street: "Baker Street", + city: "London" +}; + +final readonly & Address a2 = { + number: "308", + street: "Negra Arroyo Lane", + city: "Albuquerque" +}; + +final readonly & Address a3 = { + number: "Uknown", + street: "Unknown", + city: "Hogwarts" +}; + +final readonly & Person[] people = [p1, p2, p3]; diff --git a/ballerina-tests/graphql-advanced-test-suite/values.bal b/ballerina-tests/graphql-advanced-test-suite/values.bal new file mode 100644 index 000000000..f6d1c2e44 --- /dev/null +++ b/ballerina-tests/graphql-advanced-test-suite/values.bal @@ -0,0 +1,29 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +isolated table key(id) profileTable = table [ + {id: 1, name: "Alice", age: 25}, + {id: 2, name: "Bob", age: 30}, + {id: 3, name: "Charlie", age: 35}, + {id: 4, name: "David", age: 40} +]; + +isolated table key(id) ratingTable = table [ + {id: 1, title: "Good", stars: 4, description: "Good product", authorId: 1}, + {id: 2, title: "Bad", stars: 2, description: "Bad product", authorId: 2}, + {id: 3, title: "Excellent", stars: 5, description: "Excellent product", authorId: 3}, + {id: 4, title: "Poor", stars: 1, description: "Poor product", authorId: 4} +]; diff --git a/ballerina-tests/tests/35_client_test.bal b/ballerina-tests/graphql-client-test-suite/tests/01_client_test.bal similarity index 71% rename from ballerina-tests/tests/35_client_test.bal rename to ballerina-tests/graphql-client-test-suite/tests/01_client_test.bal index 7ce1540e9..1542bb79a 100644 --- a/ballerina-tests/tests/35_client_test.bal +++ b/ballerina-tests/graphql-client-test-suite/tests/01_client_test.bal @@ -15,13 +15,14 @@ // under the License. import ballerina/graphql; +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithJson() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -33,14 +34,14 @@ isolated function testClientExecuteWithTypeWithJson() returns error? { "greet": "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithOpenRecord() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -52,14 +53,14 @@ isolated function testClientExecuteWithTypeWithOpenRecord() returns error? { "greet": "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithKnownRecord() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -71,14 +72,14 @@ isolated function testClientExecuteWithTypeWithKnownRecord() returns error? { greet: "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithGenericRecord() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -90,14 +91,14 @@ isolated function testClientExecuteWithTypeWithGenericRecord() returns error? { greet: "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithJson() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -109,14 +110,14 @@ isolated function testClientExecuteWithJson() returns error? { "greet": "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithOpenRecord() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -128,14 +129,14 @@ isolated function testClientExecuteWithOpenRecord() returns error? { "greet": "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithKnownRecord() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -147,14 +148,14 @@ isolated function testClientExecuteWithKnownRecord() returns error? { greet: "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithGenericRecord() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -166,14 +167,14 @@ isolated function testClientExecuteWithGenericRecord() returns error? { greet: "Hello, Roland" } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithInvalidRequest() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ gree (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -196,7 +197,7 @@ isolated function testClientExecuteWithTypeWithInvalidRequest() returns error? { groups: ["client"] } isolated function testClientExecuteWithInvalidRequest() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ gree (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -219,7 +220,7 @@ isolated function testClientExecuteWithInvalidRequest() returns error? { groups: ["client"] } isolated function testClientExecuteWithTypeWithInvalidBindingType() returns error? { - string url = "http://localhost:9091/inputs"; + string url = "http://localhost:9090/inputs"; string document = string `query Greeting ($userName:String!){ greet (name: $userName) }`; string userName = "Roland"; map variables = {"userName": userName}; @@ -235,7 +236,7 @@ isolated function testClientExecuteWithTypeWithInvalidBindingType() returns erro groups: ["client"] } isolated function testClientExecuteWithTypeWithPartialDataRequest() returns error? { - string url = "http://localhost:9095/special_types"; + string url = "http://localhost:9090/special_types"; string document = string `query { specialHolidays }`; graphql:Client graphqlClient = check new (url); @@ -261,14 +262,14 @@ isolated function testClientExecuteWithTypeWithPartialDataRequest() returns erro ], extensions: null }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithPartialDataRequest() returns error? { - string url = "http://localhost:9095/special_types"; + string url = "http://localhost:9090/special_types"; string document = string `query { specialHolidays }`; graphql:Client graphqlClient = check new (url); @@ -290,15 +291,15 @@ isolated function testClientExecuteWithPartialDataRequest() returns error? { specialHolidays: ["TUESDAY", null, "THURSDAY"] } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithMultipleOperationsWithoutOperationNameInRequest() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); graphql:Client graphqlClient = check new (url); json|graphql:ClientError payload = graphqlClient->executeWithType(document); @@ -318,8 +319,8 @@ isolated function testClientExecuteWithTypeWithMultipleOperationsWithoutOperatio groups: ["client"] } isolated function testClientExecuteWithMultipleOperationsWithoutOperationNameInRequest() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); graphql:Client graphqlClient = check new (url); json|graphql:ClientError payload = graphqlClient->execute(document); @@ -339,33 +340,33 @@ isolated function testClientExecuteWithMultipleOperationsWithoutOperationNameInR groups: ["client"] } isolated function testClientExecuteWithTypeWithMultipleOperationsWithOperationNameInRequest() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->executeWithType(document, operationName = "getDetective"); json expectedPayload = {"data": {"detective": {"name": "Sherlock Holmes"}}}; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithMultipleOperationsWithOperationNameInRequest() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->execute(document, operationName = "getDetective"); json expectedPayload = {"data": {"detective": {"name": "Sherlock Holmes"}}}; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithMutation() returns error? { - string url = "http://localhost:9091/mutations"; + string url = "http://localhost:9090/mutations"; string document = string `mutation { setName(name: "Heisenberg") { name } }`; graphql:Client graphqlClient = check new (url); @@ -377,14 +378,14 @@ isolated function testClientExecuteWithTypeWithMutation() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithMutation() returns error? { - string url = "http://localhost:9091/mutations"; + string url = "http://localhost:9090/mutations"; string document = string `mutation { setName(name: "Heisenberg") { name } }`; graphql:Client graphqlClient = check new (url); @@ -396,15 +397,15 @@ isolated function testClientExecuteWithMutation() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithAlias() returns error? { - string url = "http://localhost:9094/profiles"; - string document = check getGraphqlDocumentFromFile("alias"); + string url = "http://localhost:9090/profiles"; + string document = check common:getGraphqlDocumentFromFile("alias"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->executeWithType(document); @@ -420,15 +421,15 @@ isolated function testClientExecuteWithTypeWithAlias() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithAlias() returns error? { - string url = "http://localhost:9094/profiles"; - string document = check getGraphqlDocumentFromFile("alias"); + string url = "http://localhost:9090/profiles"; + string document = check common:getGraphqlDocumentFromFile("alias"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->execute(document); @@ -444,14 +445,14 @@ isolated function testClientExecuteWithAlias() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithEnum() returns error? { - string url = "http://localhost:9095/special_types"; + string url = "http://localhost:9090/special_types"; string document = "query { time { weekday } }"; graphql:Client graphqlClient = check new (url); @@ -463,14 +464,14 @@ isolated function testClientExecuteWithTypeWithEnum() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithEnum() returns error? { - string url = "http://localhost:9095/special_types"; + string url = "http://localhost:9090/special_types"; string document = "query { time { weekday } }"; graphql:Client graphqlClient = check new (url); @@ -482,92 +483,92 @@ isolated function testClientExecuteWithEnum() returns error? { } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithFragmentsOnRecordObjects() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("fragments_on_record_objects"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("fragments_on_record_objects"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->executeWithType(document); - json expectedPayload = check getJsonContentFromFile("fragments_on_record_objects"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("fragments_on_record_objects"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithFragmentsOnRecordObjects() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("fragments_on_record_objects"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("fragments_on_record_objects"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("fragments_on_record_objects"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("fragments_on_record_objects"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithNestedFragments() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("nested_fragments"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("nested_fragments"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->executeWithType(document); - json expectedPayload = check getJsonContentFromFile("nested_fragments"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("nested_fragments"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithNestedFragments() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("nested_fragments"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("nested_fragments"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("nested_fragments"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("nested_fragments"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithInlineFragment() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("inline_fragment"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("inline_fragment"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->executeWithType(document); - json expectedPayload = check getJsonContentFromFile("inline_fragment"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("inline_fragment"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithInlineFragment() returns error? { - string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile("inline_fragment"); + string url = "http://localhost:9090/records"; + string document = check common:getGraphqlDocumentFromFile("inline_fragment"); graphql:Client graphqlClient = check new (url); json actualPayload = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("inline_fragment"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("inline_fragment"); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithTypeWithBallerinaRecordAsGraphqlObject() returns error? { - string url = "http://localhost:9091/records"; + string url = "http://localhost:9090/records"; string document = "query getPerson { detective { name, address { street } } }"; graphql:Client graphqlClient = check new (url); @@ -582,14 +583,14 @@ isolated function testClientExecuteWithTypeWithBallerinaRecordAsGraphqlObject() } } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { groups: ["client"] } isolated function testClientExecuteWithBallerinaRecordAsGraphqlObject() returns error? { - string url = "http://localhost:9091/records"; + string url = "http://localhost:9090/records"; string document = "query getPerson { detective { name, address { street } } }"; graphql:Client graphqlClient = check new (url); @@ -604,7 +605,7 @@ isolated function testClientExecuteWithBallerinaRecordAsGraphqlObject() returns } } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { @@ -612,7 +613,7 @@ isolated function testClientExecuteWithBallerinaRecordAsGraphqlObject() returns } isolated function testClientExecuteWithTypeWithRecordTypeArrays() returns error? { string document = "{ people { name address { city } } }"; - string url = "http://localhost:9091/records"; + string url = "http://localhost:9090/records"; graphql:Client graphqlClient = check new (url); PeopleResponse actualPayload = check graphqlClient->executeWithType(document); @@ -640,7 +641,7 @@ isolated function testClientExecuteWithTypeWithRecordTypeArrays() returns error? ] } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { @@ -648,7 +649,7 @@ isolated function testClientExecuteWithTypeWithRecordTypeArrays() returns error? } isolated function testClientExecuteWithRecordTypeArrays() returns error? { string document = "{ people { name address { city } } }"; - string url = "http://localhost:9091/records"; + string url = "http://localhost:9090/records"; graphql:Client graphqlClient = check new (url); PeopleResponseWithErrors actualPayload = check graphqlClient->executeWithType(document); @@ -676,7 +677,7 @@ isolated function testClientExecuteWithRecordTypeArrays() returns error? { ] } }; - assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); + common:assertJsonValuesWithOrder(actualPayload.toJson(), expectedPayload.toJson()); } @test:Config { @@ -684,7 +685,7 @@ isolated function testClientExecuteWithRecordTypeArrays() returns error? { } isolated function testClientExecuteForDataBindingError() returns error? { string document = "{ one: profile(id: 100) {name} }"; - string url = "http://localhost:9091/records"; + string url = "http://localhost:9090/records"; graphql:Client graphqlClient = check new (url); ProfileResponseWithErrors|graphql:ClientError payload = graphqlClient->execute(document); @@ -706,7 +707,7 @@ isolated function testClientExecuteForDataBindingError() returns error? { groups: ["client"] } isolated function testClientDataBindingErrorHavingACause() returns error? { - string url = "http://localhost:9095/special_types"; + string url = "http://localhost:9090/special_types"; string document = string `query { specialHolidays }`; graphql:Client graphqlClient = check new (url); @@ -725,133 +726,3 @@ isolated function testClientDataBindingErrorHavingACause() returns error? { test:assertEquals(actualErrorDetails, expectedErrorDetails); test:assertTrue(err.cause() !is (), "PayloadBindingError should have a cause"); } - -@test:Config { - groups: ["client"] -} -isolated function testClientConfiguration() returns error? { - string document = "{ greeting }"; - string url = "https://localhost:9096/basicAuth "; - - graphql:Client graphqlClient = check new (url, - cache = {enabled: true, isShared: true}, - timeout = 1, - http1Settings = {keepAlive: "NEVER"}, - secureSocket = {cert: {path: TRUSTSTORE_PATH, password: "ballerina"}}, - auth = {username: "alice", password: "xxx"}, - poolConfig = {maxActiveConnections: 1}, - circuitBreaker = {statusCodes: [500, 404]}, - retryConfig = {count: 3}, - cookieConfig = {enabled: true} - ); - - json payload = check graphqlClient->execute(document); - json expectedPayload = {data: {greeting: "Hello World!"}}; - test:assertEquals(payload, expectedPayload); -} - -type ProfileResponseWithErrors record {| - *graphql:GenericResponseWithErrors; - ProfileResponse data; -|}; - -type ProfileResponse record {| - ProfileData one; -|}; - -type ProfileData record { - string name; -}; - -type GreetingResponse record {| - map extensions?; - record {| - string greet; - |} data; -|}; - -type GenericGreetingResponse record {| - map extensions?; - map data?; -|}; - -type GreetingResponseWithErrors record {| - map extensions?; - record {| - string greet; - |} data; - graphql:ErrorDetail[] errors?; -|}; - -type GenericGreetingResponseWithErrors record {| - map extensions?; - map data?; - graphql:ErrorDetail[] errors?; -|}; - -type SetNameResponse record {| - map extensions?; - record {| - record {| - string name; - |} setName; - |} data; -|}; - -type SetNameResponseWithErrors record {| - map extensions?; - record {| - record {| - string name; - |} setName; - |} data; - graphql:ErrorDetail[] errors?; -|}; - -type PersonResponse record {| - map extensions?; - PersonDataResponse data; -|}; - -type PersonResponseWithErrors record {| - map extensions?; - PersonDataResponse data; - graphql:ErrorDetail[] errors?; -|}; - -type PersonDataResponse record {| - DetectiveResponse detective; -|}; - -type DetectiveResponse record {| - string name; - AddressResponse address; -|}; - -type AddressResponse record {| - string street; -|}; - -type PeopleResponse record {| - map extensions?; - PeopleDataResponse data; -|}; - -type PeopleResponseWithErrors record {| - map extensions?; - PeopleDataResponse data; - graphql:ErrorDetail[] errors?; -|}; - -type PeopleDataResponse record {| - PersonInfoResponse[] people; -|}; - -type PersonInfoResponse record {| - string name; - AddressInfoResponse address; -|}; - -type AddressInfoResponse record {| - string city; -|}; diff --git a/ballerina-tests/graphql-client-test-suite/tests/listeners.bal b/ballerina-tests/graphql-client-test-suite/tests/listeners.bal new file mode 100644 index 000000000..f094cfe5b --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/listeners.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener graphqlListener = new (9090); diff --git a/ballerina-tests/graphql-client-test-suite/tests/records.bal b/ballerina-tests/graphql-client-test-suite/tests/records.bal new file mode 100644 index 000000000..f0556670b --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/records.bal @@ -0,0 +1,166 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +public type Person readonly & record { + string name; + int age?; + Address address; +}; + +public type Address readonly & record { + string number; + string street; + string city; +}; + +public type Student readonly & record { + string name; + Course[] courses; +}; + +type Course readonly & record { + string name; + int code; + Book[] books; +}; + +public type Book readonly & record { + string name; + string author; +}; + +public type Time record {| + Weekday weekday; + string time; +|}; + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} + +type ProfileResponseWithErrors record {| + *graphql:GenericResponseWithErrors; + ProfileResponse data; +|}; + +type ProfileResponse record {| + ProfileData one; +|}; + +type ProfileData record { + string name; +}; + +type GreetingResponse record {| + map extensions?; + record {| + string greet; + |} data; +|}; + +type GenericGreetingResponse record {| + map extensions?; + map data?; +|}; + +type GreetingResponseWithErrors record {| + map extensions?; + record {| + string greet; + |} data; + graphql:ErrorDetail[] errors?; +|}; + +type GenericGreetingResponseWithErrors record {| + map extensions?; + map data?; + graphql:ErrorDetail[] errors?; +|}; + +type SetNameResponse record {| + map extensions?; + record {| + record {| + string name; + |} setName; + |} data; +|}; + +type SetNameResponseWithErrors record {| + map extensions?; + record {| + record {| + string name; + |} setName; + |} data; + graphql:ErrorDetail[] errors?; +|}; + +type PersonResponse record {| + map extensions?; + PersonDataResponse data; +|}; + +type PersonResponseWithErrors record {| + map extensions?; + PersonDataResponse data; + graphql:ErrorDetail[] errors?; +|}; + +type PersonDataResponse record {| + DetectiveResponse detective; +|}; + +type DetectiveResponse record {| + string name; + AddressResponse address; +|}; + +type AddressResponse record {| + string street; +|}; + +type PeopleResponse record {| + map extensions?; + PeopleDataResponse data; +|}; + +type PeopleResponseWithErrors record {| + map extensions?; + PeopleDataResponse data; + graphql:ErrorDetail[] errors?; +|}; + +type PeopleDataResponse record {| + PersonInfoResponse[] people; +|}; + +type PersonInfoResponse record {| + string name; + AddressInfoResponse address; +|}; + +type AddressInfoResponse record {| + string city; +|}; diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/documents/alias.graphql b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/alias.graphql new file mode 100644 index 000000000..24ffe151a --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/alias.graphql @@ -0,0 +1,10 @@ +query getPerson { + sherlock: profile { + name { + first + } + address { + city + } + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/documents/fragments_on_record_objects.graphql b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/fragments_on_record_objects.graphql new file mode 100644 index 000000000..2772b10c7 --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/fragments_on_record_objects.graphql @@ -0,0 +1,9 @@ +query { + ...data +} + +fragment data on Query { + people { + name + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/documents/inline_fragment.graphql b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/inline_fragment.graphql new file mode 100644 index 000000000..82b0a0eec --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/inline_fragment.graphql @@ -0,0 +1,17 @@ +query { + ... on Query { + people { + ... on Person { + address { + city + } + } + } + } + + ... on Query { + students { + name + } + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql new file mode 100644 index 000000000..ea291082f --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql @@ -0,0 +1,11 @@ +query getDetective { + detective { + name + } +} + +query getAge { + teacher { + age + } +} diff --git a/ballerina-tests/tests/resources/documents/nested_fragments.graphql b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/nested_fragments.graphql similarity index 53% rename from ballerina-tests/tests/resources/documents/nested_fragments.graphql rename to ballerina-tests/graphql-client-test-suite/tests/resources/documents/nested_fragments.graphql index 0eed745f2..094b34932 100644 --- a/ballerina-tests/tests/resources/documents/nested_fragments.graphql +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/documents/nested_fragments.graphql @@ -1,23 +1,23 @@ query { - ...data + ...data } fragment data on Query { - people { - ...AddressFragment - } + people { + ...AddressFragment + } } fragment AddressFragment on Person { - address { - ...CityFragment - } + address { + ...CityFragment + } } fragment CityFragment on Address { - ...CityFragmentDuplicate + ...CityFragmentDuplicate } fragment CityFragmentDuplicate on Address { - city + city } diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/fragments_on_record_objects.json b/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/fragments_on_record_objects.json new file mode 100644 index 000000000..7a06167c3 --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/fragments_on_record_objects.json @@ -0,0 +1,15 @@ +{ + "data": { + "people": [ + { + "name": "Sherlock Holmes" + }, + { + "name": "Walter White" + }, + { + "name": "Tom Marvolo Riddle" + } + ] + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/inline_fragment.json b/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/inline_fragment.json new file mode 100644 index 000000000..d4882696c --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/inline_fragment.json @@ -0,0 +1,32 @@ +{ + "data": { + "people": [ + { + "address": { + "city": "London" + } + }, + { + "address": { + "city": "Albuquerque" + } + }, + { + "address": { + "city": "Hogwarts" + } + } + ], + "students": [ + { + "name": "John Doe" + }, + { + "name": "Jane Doe" + }, + { + "name": "Jonny Doe" + } + ] + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/nested_fragments.json b/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/nested_fragments.json new file mode 100644 index 000000000..2181e2b51 --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/resources/expected_results/nested_fragments.json @@ -0,0 +1,21 @@ +{ + "data": { + "people": [ + { + "address": { + "city": "London" + } + }, + { + "address": { + "city": "Albuquerque" + } + }, + { + "address": { + "city": "Hogwarts" + } + } + ] + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/services.bal b/ballerina-tests/graphql-client-test-suite/tests/services.bal new file mode 100644 index 000000000..f0d224515 --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/services.bal @@ -0,0 +1,102 @@ +// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +service /inputs on graphqlListener { + isolated resource function get greet(string name) returns string { + return "Hello, " + name; + } +} + +service /records on graphqlListener { + isolated resource function get detective() returns Person { + return { + name: "Sherlock Holmes", + age: 40, + address: {number: "221/B", street: "Baker Street", city: "London"} + }; + } + + isolated resource function get teacher() returns Person { + return { + name: "Walter White", + age: 50, + address: {number: "308", street: "Negra Arroyo Lane", city: "Albuquerque"} + }; + } + + isolated resource function get student() returns Person { + return { + name: "Jesse Pinkman", + age: 25, + address: {number: "9809", street: "Margo Street", city: "Albuquerque"} + }; + } + + resource function get profile(int id) returns Person|error { + return trap people[id]; + } + + resource function get people() returns Person[] { + return people; + } + + resource function get students() returns Student[] { + return students; + } +} + +service /special_types on graphqlListener { + isolated resource function get time() returns Time { + return { + weekday: MONDAY, + time: "22:10:33" + }; + } + + isolated resource function get specialHolidays() returns (Weekday|error)?[] { + return [TUESDAY, error("Holiday!"), THURSDAY]; + } +} + +isolated service /mutations on graphqlListener { + private Person p; + + isolated function init() { + self.p = p2.clone(); + } + + isolated resource function get greet(string name) returns string { + return "Hello, " + name; + } + + isolated remote function setName(string name) returns Person { + lock { + Person p = {name: name, age: self.p.age, address: self.p.address}; + self.p = p; + return self.p; + } + } +} + +service /profiles on graphqlListener { + isolated resource function get profile/name/first() returns string { + return "Sherlock"; + } + + isolated resource function get profile/address/city() returns string { + return "London"; + } +} diff --git a/ballerina-tests/graphql-client-test-suite/tests/values.bal b/ballerina-tests/graphql-client-test-suite/tests/values.bal new file mode 100644 index 000000000..9f79bf73f --- /dev/null +++ b/ballerina-tests/graphql-client-test-suite/tests/values.bal @@ -0,0 +1,117 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +final readonly & Person p1 = { + name: "Sherlock Holmes", + age: 40, + address: a1 +}; + +final readonly & Person p2 = { + name: "Walter White", + age: 50, + address: a2 +}; + +final readonly & Person p3 = { + name: "Tom Marvolo Riddle", + age: 100, + address: a3 +}; + +final readonly & Address a1 = { + number: "221/B", + street: "Baker Street", + city: "London" +}; + +final readonly & Address a2 = { + number: "308", + street: "Negra Arroyo Lane", + city: "Albuquerque" +}; + +final readonly & Address a3 = { + number: "Uknown", + street: "Unknown", + city: "Hogwarts" +}; + +final readonly & Student s1 = { + name: "John Doe", + courses: [c1, c2] +}; + +final readonly & Student s2 = { + name: "Jane Doe", + courses: [c2, c3] +}; + +final readonly & Student s3 = { + name: "Jonny Doe", + courses: [c1, c2, c3] +}; + +final readonly & Course c1 = { + name: "Electronics", + code: 106, + books: [b1, b2] +}; + +final readonly & Course c2 = { + name: "Computer Science", + code: 107, + books: [b3, b4] +}; + +final readonly & Course c3 = { + name: "Mathematics", + code: 105, + books: [b5, b6] +}; + +final readonly & Book b1 = { + name: "The Art of Electronics", + author: "Paul Horowitz" +}; + +final readonly & Book b2 = { + name: "Practical Electronics", + author: "Paul Scherz" +}; + +final readonly & Book b3 = { + name: "Algorithms to Live By", + author: "Brian Christian" +}; + +final readonly & Book b4 = { + name: "Code: The Hidden Language", + author: "Charles Petzold" +}; + +final readonly & Book b5 = { + name: "Calculus Made Easy", + author: "Silvanus P. Thompson" +}; + +final readonly & Book b6 = { + name: "Calculus", + author: "Michael Spivak" +}; + +final readonly & Student[] students = [s1, s2, s3]; +final readonly & Person[] people = [p1, p2, p3]; diff --git a/ballerina-tests/tests/41_dataloader.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal similarity index 56% rename from ballerina-tests/tests/41_dataloader.bal rename to ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal index 10b45dbca..c47848cf9 100644 --- a/ballerina-tests/tests/41_dataloader.bal +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal @@ -15,6 +15,7 @@ // under the License. import ballerina/graphql; +import ballerina/graphql_test_common as common; import ballerina/test; import ballerina/websocket; @@ -24,10 +25,10 @@ import ballerina/websocket; } isolated function testDataLoaderWithQuery() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); - string document = check getGraphqlDocumentFromFile("dataloader_with_query"); + string document = check common:getGraphqlDocumentFromFile("dataloader_with_query"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("dataloader_with_query"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("dataloader_with_query"); + common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(1); } @@ -38,29 +39,28 @@ isolated function testDataLoaderWithQuery() returns error? { } isolated function testDataLoaderWithDifferentAliasForSameField() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); - string document = check getGraphqlDocumentFromFile("dataloader_with_different_alias_for_same_field"); + string document = check common:getGraphqlDocumentFromFile("dataloader_with_different_alias_for_same_field"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("dataloader_with_different_alias_for_same_field"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("dataloader_with_different_alias_for_same_field"); + common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(1); } @test:Config { groups: ["subscriptions", "dataloader"], - after: resetDispatchCounters, - enable: false + after: resetDispatchCounters } isolated function testDataLoaderWithSubscription() returns error? { - string document = check getGraphqlDocumentFromFile("dataloader_with_subscription"); + string document = check common:getGraphqlDocumentFromFile("dataloader_with_subscription"); websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient = check new ("ws://localhost:9090/dataloader", config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document, "1"); - json[] authorSequence = check getJsonContentFromFile("data_loader_with_subscription").ensureType(); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, "1"); + json[] authorSequence = check common:getJsonContentFromFile("data_loader_with_subscription").ensureType(); foreach int i in 0 ..< 5 { json expectedMsgPayload = {data: {authors: authorSequence[i]}}; - check validateNextMessage(wsClient, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient, expectedMsgPayload, id = "1"); } assertDispatchCountForBookLoader(5); } @@ -68,17 +68,17 @@ isolated function testDataLoaderWithSubscription() returns error? { @test:Config { groups: ["dataloader", "mutation"], dependsOn: [ - testDataLoaderWithQuery - // , testDataLoaderWithSubscription + testDataLoaderWithQuery, + testDataLoaderWithSubscription ], after: resetDispatchCounters } isolated function testDataLoaderWithMutation() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); - string document = check getGraphqlDocumentFromFile("dataloader_with_mutation"); + string document = check common:getGraphqlDocumentFromFile("dataloader_with_mutation"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("dataloader_with_mutation"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("dataloader_with_mutation"); + common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForUpdateAuthorLoader(1); assertDispatchCountForBookLoader(1); } @@ -89,10 +89,10 @@ isolated function testDataLoaderWithMutation() returns error? { } isolated function testDataLoaderWithInterceptors() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader_with_interceptor"); - string document = check getGraphqlDocumentFromFile("dataloader_with_interceptor"); + string document = check common:getGraphqlDocumentFromFile("dataloader_with_interceptor"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("dataloader_with_interceptor"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("dataloader_with_interceptor"); + common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(1); } @@ -103,10 +103,10 @@ isolated function testDataLoaderWithInterceptors() returns error? { } isolated function testBatchFunctionReturningErrors() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); - string document = check getGraphqlDocumentFromFile("batch_function_returing_errors"); + string document = check common:getGraphqlDocumentFromFile("batch_function_returing_errors"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("batch_function_returing_errors"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("batch_function_returing_errors"); + common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(0); } @@ -117,38 +117,8 @@ isolated function testBatchFunctionReturningErrors() returns error? { } isolated function testBatchFunctionReturingNonMatchingNumberOfResults() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader_with_faulty_batch_function"); - string document = check getGraphqlDocumentFromFile("batch_function_returning_non_matcing_number_of_results"); + string document = check common:getGraphqlDocumentFromFile("batch_function_returning_non_matcing_number_of_results"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("batch_function_returning_non_matcing_number_of_results"); - assertJsonValuesWithOrder(response, expectedPayload); -} - -isolated function resetDispatchCounters() { - lock { - dispatchCountOfAuthorLoader = 0; - } - lock { - dispatchCountOfBookLoader = 0; - } - lock { - dispatchCountOfUpdateAuthorLoader = 0; - } -} - -isolated function assertDispatchCountForBookLoader(int expectedCount) { - lock { - test:assertEquals(dispatchCountOfBookLoader, expectedCount); - } -} - -isolated function assertDispatchCountForUpdateAuthorLoader(int expectedCount) { - lock { - test:assertEquals(dispatchCountOfUpdateAuthorLoader, expectedCount); - } -} - -isolated function assertDispatchCountForAuthorLoader(int expectedCount) { - lock { - test:assertEquals(dispatchCountOfAuthorLoader, expectedCount); - } + json expectedPayload = check common:getJsonContentFromFile("batch_function_returning_non_matcing_number_of_results"); + common:assertJsonValuesWithOrder(response, expectedPayload); } diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal new file mode 100644 index 000000000..be29b3698 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal @@ -0,0 +1,64 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; + +@test:Config { + groups: ["server_cache", "data_loader"], + dataProvider: dataProviderServerCacheWithDataloader +} +isolated function testServerSideCacheWithDataLoader(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/caching_with_dataloader"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } + resetDispatchCounters(); +} + +function dataProviderServerCacheWithDataloader() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache_with_dataloader", ["server_cache_with_dataloader_1", "server_cache_with_dataloader_2", "server_cache_with_dataloader_1"], (), ["A", "B", "A"]], + "2": ["server_cache_eviction_with_dataloader", ["server_cache_with_dataloader_1", "server_cache_with_dataloader_2", "server_cache_with_dataloader_3"], (), ["A", "B", "A"]] + }; + return dataSet; +} + +@test:Config { + groups: ["server_cache", "data_loader"], + dataProvider: dataProviderServerCacheWithDataloaderInOperationalLevel +} +isolated function testServerSideCacheWithDataLoaderInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/caching_with_dataloader_operational"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } + resetDispatchCounters(); +} + +function dataProviderServerCacheWithDataloaderInOperationalLevel() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache_with_dataloader_operational", ["server_cache_with_dataloader_3", "server_cache_with_dataloader_5", "server_cache_with_dataloader_3"], (), ["A", "B", "A"]], + "2": ["server_cache_eviction_with_dataloader_operational", ["server_cache_with_dataloader_3", "server_cache_with_dataloader_5", "server_cache_with_dataloader_4"], (), ["A", "B", "A"]] + }; + return dataSet; +} diff --git a/ballerina-tests/tests/batch_load_functions.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/batch_load_functions.bal similarity index 100% rename from ballerina-tests/tests/batch_load_functions.bal rename to ballerina-tests/graphql-dataloader-test-suite/tests/batch_load_functions.bal diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/interceptors.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/interceptors.bal new file mode 100644 index 000000000..07bd538ff --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/interceptors.bal @@ -0,0 +1,37 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +readonly service class AuthorInterceptor { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata { + var data = context.resolve('field); + // Return only the first author + return ('field.getName() == "authors" && data is anydata[]) ? [data[0]] : data; + } +} + +readonly service class BookInterceptor { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata { + var books = context.resolve('field); + // Return only the first book + return (books is anydata[]) ? [books[0]] : books; + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/listeners.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/listeners.bal new file mode 100644 index 000000000..e0a0c54fa --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/listeners.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +listener http:Listener httpListener = new (9090, httpVersion = http:HTTP_1_1); +listener graphql:Listener wrappedListener = new (httpListener); diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/object_types.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/object_types.bal new file mode 100644 index 000000000..76d3d6ba8 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/object_types.bal @@ -0,0 +1,110 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/graphql.dataloader; + +public isolated distinct service class AuthorData { + private final readonly & AuthorRow author; + + isolated function init(AuthorRow author) { + self.author = author.cloneReadOnly(); + } + + isolated resource function get name() returns string { + return self.author.name; + } + + isolated function preBooks(graphql:Context ctx) { + dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); + bookLoader.add(self.author.id); + } + + isolated resource function get books(graphql:Context ctx) returns BookData[]|error { + dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); + BookRow[] bookrows = check bookLoader.get(self.author.id); + return from BookRow bookRow in bookrows + select new BookData(bookRow); + } +} + +public isolated distinct service class AuthorDetail { + private final readonly & AuthorRow author; + + isolated function init(AuthorRow author) { + self.author = author.cloneReadOnly(); + } + + isolated resource function get name() returns string { + return self.author.name; + } + + isolated function prefetchBooks(graphql:Context ctx) { + dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); + bookLoader.add(self.author.id); + } + + @graphql:ResourceConfig { + interceptors: new BookInterceptor(), + prefetchMethodName: "prefetchBooks" + } + isolated resource function get books(graphql:Context ctx) returns BookData[]|error { + dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); + BookRow[] bookrows = check bookLoader.get(self.author.id); + return from BookRow bookRow in bookrows + select new BookData(bookRow); + } +} + +public isolated distinct service class BookData { + private final readonly & BookRow book; + + isolated function init(BookRow book) { + self.book = book.cloneReadOnly(); + } + + isolated resource function get id() returns int { + return self.book.id; + } + + isolated resource function get title() returns string { + return self.book.title; + } +} + +public isolated distinct service class AuthorData2 { + private final readonly & AuthorRow author; + + isolated function init(AuthorRow author) { + self.author = author.cloneReadOnly(); + } + + isolated resource function get name() returns string { + return self.author.name; + } + + isolated function preBooks(graphql:Context ctx) { + dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER_2); + bookLoader.add(self.author.id); + } + + isolated resource function get books(graphql:Context ctx) returns BookData[]|error { + dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER_2); + BookRow[] bookrows = check bookLoader.get(self.author.id); + return from BookRow bookRow in bookrows + select new BookData(bookRow); + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/records.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/records.bal new file mode 100644 index 000000000..090afceb5 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/records.bal @@ -0,0 +1,26 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +type BookRow record {| + readonly int id; + string title; + int author; +|}; + +type AuthorRow record {| + readonly int id; + string name; +|}; diff --git a/ballerina-tests/tests/resources/documents/batch_function_returing_errors.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/batch_function_returing_errors.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/batch_function_returing_errors.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/batch_function_returing_errors.graphql diff --git a/ballerina-tests/tests/resources/documents/batch_function_returning_non_matcing_number_of_results.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/batch_function_returning_non_matcing_number_of_results.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/batch_function_returning_non_matcing_number_of_results.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/batch_function_returning_non_matcing_number_of_results.graphql diff --git a/ballerina-tests/tests/resources/documents/dataloader_with_different_alias_for_same_field.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_different_alias_for_same_field.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/dataloader_with_different_alias_for_same_field.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_different_alias_for_same_field.graphql diff --git a/ballerina-tests/tests/resources/documents/dataloader_with_interceptor.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_interceptor.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/dataloader_with_interceptor.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_interceptor.graphql diff --git a/ballerina-tests/tests/resources/documents/dataloader_with_mutation.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_mutation.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/dataloader_with_mutation.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_mutation.graphql diff --git a/ballerina-tests/tests/resources/documents/dataloader_with_query.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_query.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/dataloader_with_query.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_query.graphql diff --git a/ballerina-tests/tests/resources/documents/dataloader_with_subscription.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_subscription.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/dataloader_with_subscription.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/dataloader_with_subscription.graphql diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_dataloader.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_eviction_with_dataloader.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/server_cache_eviction_with_dataloader.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_eviction_with_dataloader.graphql index de51cf976..99ab81cdd 100644 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_dataloader.graphql +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_eviction_with_dataloader.graphql @@ -1,4 +1,4 @@ -query A { +query A { authors(ids: [1, 2, 3]) { name books { diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql index b36289f94..024c25951 100644 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_eviction_with_dataloader_operational.graphql @@ -1,4 +1,4 @@ -query A { +query A { authors(ids: [1, 2, 3]) { name books { diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_dataloader.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_with_dataloader.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/server_cache_with_dataloader.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_with_dataloader.graphql index 53848eb76..2c282a37c 100644 --- a/ballerina-tests/tests/resources/documents/server_cache_with_dataloader.graphql +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_with_dataloader.graphql @@ -1,4 +1,4 @@ -query A { +query A { authors(ids: [1, 2, 3]) { name books { diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_dataloader_operational.graphql b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_with_dataloader_operational.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/server_cache_with_dataloader_operational.graphql rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_with_dataloader_operational.graphql index 7e0792966..e6fd2eef4 100644 --- a/ballerina-tests/tests/resources/documents/server_cache_with_dataloader_operational.graphql +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/documents/server_cache_with_dataloader_operational.graphql @@ -1,4 +1,4 @@ -query A { +query A { authors(ids: [1, 2, 3]) { name books { diff --git a/ballerina-tests/tests/resources/expected_results/batch_function_returing_errors.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/batch_function_returing_errors.json similarity index 57% rename from ballerina-tests/tests/resources/expected_results/batch_function_returing_errors.json rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/batch_function_returing_errors.json index 9c3c5eef5..cc012d4d6 100644 --- a/ballerina-tests/tests/resources/expected_results/batch_function_returing_errors.json +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/batch_function_returing_errors.json @@ -2,12 +2,7 @@ "errors": [ { "message": "Invalid keys found for authors", - "locations": [ - { - "line": 2, - "column": 3 - } - ], + "locations": [{ "line": 2, "column": 3 }], "path": ["authors"] } ], diff --git a/ballerina-tests/tests/resources/expected_results/batch_function_returning_non_matcing_number_of_results.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/batch_function_returning_non_matcing_number_of_results.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/batch_function_returning_non_matcing_number_of_results.json rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/batch_function_returning_non_matcing_number_of_results.json diff --git a/ballerina-tests/tests/resources/expected_results/data_loader_with_subscription.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/data_loader_with_subscription.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/data_loader_with_subscription.json rename to ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/data_loader_with_subscription.json diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json new file mode 100644 index 000000000..61abec6e4 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json @@ -0,0 +1,32 @@ +{ + "data": { + "firstThree": [ + { + "name": "Author 1", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + { + "name": "Author 2", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + }, + { + "name": "Author 3", + "books": [ + { "id": 6, "title": "Book 6" }, + { "id": 7, "title": "Book 7" } + ] + } + ], + "lastTwo": [ + { "name": "Author 4", "books": [{ "id": 8, "title": "Book 8" }] }, + { "name": "Author 5", "books": [{ "id": 9, "title": "Book 9" }] } + ] + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_interceptor.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_interceptor.json new file mode 100644 index 000000000..4ea938b15 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_interceptor.json @@ -0,0 +1,6 @@ +{ + "data": { + "one": [{ "name": "Author 1", "books": [{ "title": "Book 1" }] }], + "four": [{ "name": "Author 4", "books": [{ "title": "Book 8" }] }] + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_mutation.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_mutation.json new file mode 100644 index 000000000..5f23cc7f7 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_mutation.json @@ -0,0 +1,19 @@ +{ + "data": { + "sabthar": { + "name": "Sabthar", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + "mahroof": { + "name": "Mahroof", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + } + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_query.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_query.json new file mode 100644 index 000000000..edc40bd0f --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/dataloader_with_query.json @@ -0,0 +1,28 @@ +{ + "data": { + "authors": [ + { + "name": "Author 1", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + { + "name": "Author 2", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + }, + { + "name": "Author 3", + "books": [ + { "id": 6, "title": "Book 6" }, + { "id": 7, "title": "Book 7" } + ] + } + ] + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_1.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_1.json new file mode 100644 index 000000000..edc40bd0f --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_1.json @@ -0,0 +1,28 @@ +{ + "data": { + "authors": [ + { + "name": "Author 1", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + { + "name": "Author 2", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + }, + { + "name": "Author 3", + "books": [ + { "id": 6, "title": "Book 6" }, + { "id": 7, "title": "Book 7" } + ] + } + ] + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_2.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_2.json new file mode 100644 index 000000000..5f23cc7f7 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_2.json @@ -0,0 +1,19 @@ +{ + "data": { + "sabthar": { + "name": "Sabthar", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + "mahroof": { + "name": "Mahroof", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + } + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_3.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_3.json new file mode 100644 index 000000000..6cad0b28d --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_3.json @@ -0,0 +1,28 @@ +{ + "data": { + "authors": [ + { + "name": "Sabthar", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + { + "name": "Mahroof", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + }, + { + "name": "Author 3", + "books": [ + { "id": 6, "title": "Book 6" }, + { "id": 7, "title": "Book 7" } + ] + } + ] + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_4.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_4.json new file mode 100644 index 000000000..bd35c35ae --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_4.json @@ -0,0 +1,28 @@ +{ + "data": { + "authors": [ + { + "name": "Yual Noah Harari", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + { + "name": "Mark Manson", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + }, + { + "name": "Author 3", + "books": [ + { "id": 6, "title": "Book 6" }, + { "id": 7, "title": "Book 7" } + ] + } + ] + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_5.json b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_5.json new file mode 100644 index 000000000..b64b85cff --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/resources/expected_results/server_cache_with_dataloader_5.json @@ -0,0 +1,19 @@ +{ + "data": { + "harari": { + "name": "Yual Noah Harari", + "books": [ + { "id": 1, "title": "Book 1" }, + { "id": 2, "title": "Book 2" }, + { "id": 3, "title": "Book 3" } + ] + }, + "manson": { + "name": "Mark Manson", + "books": [ + { "id": 4, "title": "Book 4" }, + { "id": 5, "title": "Book 5" } + ] + } + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/services.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/services.bal new file mode 100644 index 000000000..31b079822 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/services.bal @@ -0,0 +1,187 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/graphql.dataloader; +import ballerina/http; + +isolated function initContext(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context ctx = new; + ctx.registerDataLoader(AUTHOR_LOADER, new dataloader:DefaultDataLoader(authorLoaderFunction)); + ctx.registerDataLoader(AUTHOR_UPDATE_LOADER, new dataloader:DefaultDataLoader(authorUpdateLoaderFunction)); + ctx.registerDataLoader(BOOK_LOADER, new dataloader:DefaultDataLoader(bookLoaderFunction)); + return ctx; +} + +@graphql:ServiceConfig { + contextInit: initContext +} +service /dataloader on wrappedListener { + function preAuthors(graphql:Context ctx, int[] ids) { + addAuthorIdsToAuthorLoader(ctx, ids); + } + + resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData[]|error { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); + AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); + return from AuthorRow authorRow in authorRows + select new (authorRow); + } + + function preUpdateAuthorName(graphql:Context ctx, int id, string name) { + [int, string] key = [id, name]; + dataloader:DataLoader authorUpdateLoader = ctx.getDataLoader(AUTHOR_UPDATE_LOADER); + authorUpdateLoader.add(key); + } + + remote function updateAuthorName(graphql:Context ctx, int id, string name) returns AuthorData|error { + [int, string] key = [id, name]; + dataloader:DataLoader authorUpdateLoader = ctx.getDataLoader(AUTHOR_UPDATE_LOADER); + AuthorRow authorRow = check authorUpdateLoader.get(key); + return new (authorRow); + } + + resource function subscribe authors() returns stream { + lock { + readonly & AuthorRow[] authorRows = authorTable.toArray().cloneReadOnly(); + return authorRows.'map(authorRow => new AuthorData(authorRow)).toStream(); + } + } +} + +@graphql:ServiceConfig { + interceptors: new AuthorInterceptor(), + contextInit: initContext +} +service /dataloader_with_interceptor on wrappedListener { + function preAuthors(graphql:Context ctx, int[] ids) { + addAuthorIdsToAuthorLoader(ctx, ids); + } + + resource function get authors(graphql:Context ctx, int[] ids) returns AuthorDetail[]|error { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); + AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); + return from AuthorRow authorRow in authorRows + select new (authorRow); + } +} + +@graphql:ServiceConfig { + interceptors: new AuthorInterceptor(), + contextInit: isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context { + graphql:Context ctx = new; + ctx.registerDataLoader(AUTHOR_LOADER, new dataloader:DefaultDataLoader(faultyAuthorLoaderFunction)); + ctx.registerDataLoader(AUTHOR_UPDATE_LOADER, new dataloader:DefaultDataLoader(authorUpdateLoaderFunction)); + ctx.registerDataLoader(BOOK_LOADER, new dataloader:DefaultDataLoader(bookLoaderFunction)); + return ctx; + } +} +service /dataloader_with_faulty_batch_function on wrappedListener { + function preAuthors(graphql:Context ctx, int[] ids) { + addAuthorIdsToAuthorLoader(ctx, ids); + } + + resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData[]|error { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); + AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); + return from AuthorRow authorRow in authorRows + select new (authorRow); + } +} + +function addAuthorIdsToAuthorLoader(graphql:Context ctx, int[] ids) { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); + ids.forEach(function(int id) { + authorLoader.add(id); + }); +} + +isolated function initContext2(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context ctx = new; + ctx.registerDataLoader(AUTHOR_LOADER_2, new dataloader:DefaultDataLoader(authorLoaderFunction2)); + ctx.registerDataLoader(BOOK_LOADER_2, new dataloader:DefaultDataLoader(bookLoaderFunction2)); + return ctx; +} + +@graphql:ServiceConfig { + contextInit: initContext2 +} +service /caching_with_dataloader on wrappedListener { + function preAuthors(graphql:Context ctx, int[] ids) { + addAuthorIdsToAuthorLoader2(ctx, ids); + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true + } + } + resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData2[]|error { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER_2); + AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); + return from AuthorRow authorRow in authorRows + select new (authorRow); + } + + isolated remote function updateAuthorName(graphql:Context ctx, int id, string name, boolean enableEvict = false) returns AuthorData2|error { + if enableEvict { + check ctx.invalidate("authors"); + } + AuthorRow authorRow = {id: id, name}; + lock { + authorTable2.put(authorRow.cloneReadOnly()); + } + return new (authorRow); + } +} + +@graphql:ServiceConfig { + cacheConfig: { + enabled: true + }, + contextInit: initContext2 +} +service /caching_with_dataloader_operational on wrappedListener { + function preAuthors(graphql:Context ctx, int[] ids) { + addAuthorIdsToAuthorLoader2(ctx, ids); + } + + resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData2[]|error { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER_2); + AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); + return from AuthorRow authorRow in authorRows + select new (authorRow); + } + + isolated remote function updateAuthorName(graphql:Context ctx, int id, string name, boolean enableEvict = false) returns AuthorData2|error { + if enableEvict { + check ctx.invalidate("authors"); + } + AuthorRow authorRow = {id: id, name}; + lock { + authorTable2.put(authorRow.cloneReadOnly()); + } + return new (authorRow); + } +} + +function addAuthorIdsToAuthorLoader2(graphql:Context ctx, int[] ids) { + dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER_2); + ids.forEach(function(int id) { + authorLoader.add(id); + }); +} + diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/utils.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/utils.bal new file mode 100644 index 000000000..44a1326ce --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/utils.bal @@ -0,0 +1,51 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/test; + +isolated int dispatchCountOfBookLoader = 0; +isolated int dispatchCountOfAuthorLoader = 0; +isolated int dispatchCountOfUpdateAuthorLoader = 0; + +isolated function resetDispatchCounters() { + lock { + dispatchCountOfAuthorLoader = 0; + } + lock { + dispatchCountOfBookLoader = 0; + } + lock { + dispatchCountOfUpdateAuthorLoader = 0; + } +} + +isolated function assertDispatchCountForBookLoader(int expectedCount) { + lock { + test:assertEquals(dispatchCountOfBookLoader, expectedCount); + } +} + +isolated function assertDispatchCountForUpdateAuthorLoader(int expectedCount) { + lock { + test:assertEquals(dispatchCountOfUpdateAuthorLoader, expectedCount); + } +} + +isolated function assertDispatchCountForAuthorLoader(int expectedCount) { + lock { + test:assertEquals(dispatchCountOfAuthorLoader, expectedCount); + } +} diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal new file mode 100644 index 000000000..3d9eca5d5 --- /dev/null +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal @@ -0,0 +1,64 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; + +const AUTHOR_LOADER = "authorLoader"; +const AUTHOR_UPDATE_LOADER = "authorUpdateLoader"; +const BOOK_LOADER = "bookLoader"; + +const AUTHOR_LOADER_2 = "authorLoader2"; +const BOOK_LOADER_2 = "bookLoader2"; + +final isolated table key(id) authorTable = table [ + {id: 1, name: "Author 1"}, + {id: 2, name: "Author 2"}, + {id: 3, name: "Author 3"}, + {id: 4, name: "Author 4"}, + {id: 5, name: "Author 5"} +]; + +final isolated table key(id) bookTable = table [ + {id: 1, title: "Book 1", author: 1}, + {id: 2, title: "Book 2", author: 1}, + {id: 3, title: "Book 3", author: 1}, + {id: 4, title: "Book 4", author: 2}, + {id: 5, title: "Book 5", author: 2}, + {id: 6, title: "Book 6", author: 3}, + {id: 7, title: "Book 7", author: 3}, + {id: 8, title: "Book 8", author: 4}, + {id: 9, title: "Book 9", author: 5} +]; + +final isolated table key(id) authorTable2 = table [ + {id: 1, name: "Author 1"}, + {id: 2, name: "Author 2"}, + {id: 3, name: "Author 3"}, + {id: 4, name: "Author 4"}, + {id: 5, name: "Author 5"} +]; + +final isolated table key(id) bookTable2 = table [ + {id: 1, title: "Book 1", author: 1}, + {id: 2, title: "Book 2", author: 1}, + {id: 3, title: "Book 3", author: 1}, + {id: 4, title: "Book 4", author: 2}, + {id: 5, title: "Book 5", author: 2}, + {id: 6, title: "Book 6", author: 3}, + {id: 7, title: "Book 7", author: 3}, + {id: 8, title: "Book 8", author: 4}, + {id: 9, title: "Book 9", author: 5} +]; diff --git a/ballerina-tests/tests/38_interceptors.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal similarity index 55% rename from ballerina-tests/tests/38_interceptors.bal rename to ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal index 661133ab7..9bade9db4 100644 --- a/ballerina-tests/tests/38_interceptors.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; import ballerina/websocket; @@ -22,39 +23,39 @@ import ballerina/websocket; dataProvider: dataProviderInterceptors } isolated function testInterceptors(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderInterceptors() returns string[][] { - string url1 = "http://localhost:9091/intercept_service_obj"; - string url2 = "http://localhost:9091/intercept_arrays"; - string url3 = "http://localhost:9091/intercept_records"; - string url4 = "http://localhost:9091/invalid_interceptor1"; - string url5 = "http://localhost:9091/invalid_interceptor2"; - string url6 = "http://localhost:9091/invalid_interceptor3"; - string url7 = "http://localhost:9091/invalid_interceptor4"; - string url8 = "http://localhost:9091/intercept_errors1"; - string url9 = "http://localhost:9091/intercept_errors2"; - string url10 = "http://localhost:9091/intercept_errors3"; - string url11 = "http://localhost:9091/intercept_erros_with_hierarchical"; - string url12 = "http://localhost:9091/interceptors_with_null_values3"; - string url13 = "http://localhost:9091/intercept_enum"; - string url14 = "http://localhost:9091/intercept_int"; - string url15 = "http://localhost:9091/intercept_order"; - string url16 = "http://localhost:9091/intercept_hierarchical"; - string url17 = "http://localhost:9091/mutation_interceptor"; - string url18 = "http://localhost:9091/interceptors_with_null_values1"; - string url19 = "http://localhost:9091/interceptors_with_null_values2"; - string url20 = "http://localhost:9091/intercept_record_fields"; - string url21 = "http://localhost:9091/intercept_map"; - string url22 = "http://localhost:9091/intercept_table"; - string url23 = "http://localhost:9091/intercept_string"; - string url24 = "http://localhost:9091/intercept_service_obj_array1"; - string url25 = "http://localhost:9091/intercept_service_obj_array2"; - string url26 = "http://localhost:9092/intercept_unions"; + string url1 = "http://localhost:9090/intercept_service_obj"; + string url2 = "http://localhost:9090/intercept_arrays"; + string url3 = "http://localhost:9090/intercept_records"; + string url4 = "http://localhost:9090/invalid_interceptor1"; + string url5 = "http://localhost:9090/invalid_interceptor2"; + string url6 = "http://localhost:9090/invalid_interceptor3"; + string url7 = "http://localhost:9090/invalid_interceptor4"; + string url8 = "http://localhost:9090/intercept_errors1"; + string url9 = "http://localhost:9090/intercept_errors2"; + string url10 = "http://localhost:9090/intercept_errors3"; + string url11 = "http://localhost:9090/intercept_erros_with_hierarchical"; + string url12 = "http://localhost:9090/interceptors_with_null_values3"; + string url13 = "http://localhost:9090/intercept_enum"; + string url14 = "http://localhost:9090/intercept_int"; + string url15 = "http://localhost:9090/intercept_order"; + string url16 = "http://localhost:9090/intercept_hierarchical"; + string url17 = "http://localhost:9090/mutation_interceptor"; + string url18 = "http://localhost:9090/interceptors_with_null_values1"; + string url19 = "http://localhost:9090/interceptors_with_null_values2"; + string url20 = "http://localhost:9090/intercept_record_fields"; + string url21 = "http://localhost:9090/intercept_map"; + string url22 = "http://localhost:9090/intercept_table"; + string url23 = "http://localhost:9090/intercept_string"; + string url24 = "http://localhost:9090/intercept_service_obj_array1"; + string url25 = "http://localhost:9090/intercept_service_obj_array2"; + string url26 = "http://localhost:9090/intercept_unions"; return [ [url1, "interceptors_with_service_object"], @@ -95,20 +96,20 @@ function dataProviderInterceptors() returns string[][] { } isolated function testInterceptorsWithSubscriptionReturningScalar() returns error? { string document = string `subscription { messages }`; - string url = "ws://localhost:9099/subscription_interceptor1"; + string url = "ws://localhost:9091/subscription_interceptor1"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1"); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2"); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); foreach int i in 1 ..< 4 { json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); } } @@ -116,56 +117,56 @@ isolated function testInterceptorsWithSubscriptionReturningScalar() returns erro groups: ["interceptors", "subscriptions", "records"] } isolated function testInterceptorsWithSubscriptionReturningRecord() returns error? { - string document = check getGraphqlDocumentFromFile("interceptors_with_subscription_return_records"); - string url = "ws://localhost:9099/subscription_interceptor2"; + string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_records"); + string url = "ws://localhost:9091/subscription_interceptor2"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, operationName = "A"); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, operationName = "A"); json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Athur Conan Doyle"}}}; - check validateNextMessage(wsClient1, expectedMsgPayload); + check common:validateNextMessage(wsClient1, expectedMsgPayload); expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "Athur Conan Doyle"}}}; - check validateNextMessage(wsClient1, expectedMsgPayload); + check common:validateNextMessage(wsClient1, expectedMsgPayload); websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, operationName = "B"); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, operationName = "B"); expectedMsgPayload = {data: {newBooks: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; - check validateNextMessage(wsClient2, expectedMsgPayload); + check common:validateNextMessage(wsClient2, expectedMsgPayload); } @test:Config { groups: ["interceptors", "fragments", "subscriptions"] } isolated function testInterceptorsWithSubscriptionAndFragments() returns error? { - string document = check getGraphqlDocumentFromFile("interceptors_with_fragments_and_subscription"); - string url = "ws://localhost:9099/subscription_interceptor3"; + string document = check common:getGraphqlDocumentFromFile("interceptors_with_fragments_and_subscription"); + string url = "ws://localhost:9091/subscription_interceptor3"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, operationName = "getStudents"); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, operationName = "getStudents"); json expectedMsgPayload = {data: {students: {id: 1, name: "Harry Potter"}}}; - check validateNextMessage(wsClient1, expectedMsgPayload); + check common:validateNextMessage(wsClient1, expectedMsgPayload); expectedMsgPayload = {data: {students: {id: 2, name: "Harry Potter"}}}; - check validateNextMessage(wsClient1, expectedMsgPayload); + check common:validateNextMessage(wsClient1, expectedMsgPayload); websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, operationName = "getNewStudents"); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, operationName = "getNewStudents"); expectedMsgPayload = {data: {newStudents: {id: 4, name: "Ron Weasley"}}}; - check validateNextMessage(wsClient2, expectedMsgPayload); + check common:validateNextMessage(wsClient2, expectedMsgPayload); } @test:Config { groups: ["interceptors", "union", "subscriptions"] } isolated function testInterceptorsWithUnionTypeSubscription() returns error? { - string document = check getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); - string url = "ws://localhost:9099/subscription_interceptor4"; + string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); + string url = "ws://localhost:9091/subscription_interceptor4"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, operationName = "unionTypes1"); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, operationName = "unionTypes1"); json expectedMsgPayload = { data: { multipleValues1: { @@ -174,7 +175,7 @@ isolated function testInterceptorsWithUnionTypeSubscription() returns error? { } } }; - check validateNextMessage(wsClient1, expectedMsgPayload); + check common:validateNextMessage(wsClient1, expectedMsgPayload); expectedMsgPayload = { data: { multipleValues1: { @@ -183,11 +184,11 @@ isolated function testInterceptorsWithUnionTypeSubscription() returns error? { } } }; - check validateNextMessage(wsClient1, expectedMsgPayload); + check common:validateNextMessage(wsClient1, expectedMsgPayload); websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, operationName = "unionTypes2"); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, operationName = "unionTypes2"); expectedMsgPayload = { data: { multipleValues2: { @@ -196,7 +197,7 @@ isolated function testInterceptorsWithUnionTypeSubscription() returns error? { } } }; - check validateNextMessage(wsClient2, expectedMsgPayload); + check common:validateNextMessage(wsClient2, expectedMsgPayload); } @test:Config { @@ -204,20 +205,20 @@ isolated function testInterceptorsWithUnionTypeSubscription() returns error? { } isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns error? { string document = string `subscription { messages }`; - string url = "ws://localhost:9099/subscription_interceptor5"; + string url = "ws://localhost:9091/subscription_interceptor5"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1"); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2"); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); json expectedMsgPayload = {data: {messages: 1}}; foreach int i in 1 ..< 4 { - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); } } @@ -226,27 +227,27 @@ isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns } isolated function testInterceptorsDestructiveModificationWithSubscription() returns error? { string document = string `subscription { messages }`; - string url = "ws://localhost:9099/subscription_interceptor6"; + string url = "ws://localhost:9091/subscription_interceptor6"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1"); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2"); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); json expectedMsgPayload = { errors: [ { - message:"Invalid return type in Interceptor \"DestructiveModification\". Expected type Int!", - locations:[ + message: "Invalid return type in Interceptor \"DestructiveModification\". Expected type Int!", + locations: [ { - line:1, - column:16 + line: 1, + column: 16 } ], - path:[ + path: [ "messages" ] }, @@ -264,8 +265,8 @@ isolated function testInterceptorsDestructiveModificationWithSubscription() retu data: null }; foreach int i in 1 ..< 4 { - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); } } @@ -274,35 +275,35 @@ isolated function testInterceptorsDestructiveModificationWithSubscription() retu } isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns error? { final string document = string `subscription { messages }`; - string url = "ws://localhost:9099/subscription_interceptor1"; + string url = "ws://localhost:9091/subscription_interceptor1"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; final websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); + check common:initiateGraphqlWsConnection(wsClient1); final websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); + check common:initiateGraphqlWsConnection(wsClient2); final websocket:Client wsClient3 = check new (url, config); - check initiateGraphqlWsConnection(wsClient3); + check common:initiateGraphqlWsConnection(wsClient3); worker A returns error? { - check sendSubscriptionMessage(wsClient1, document, "1"); + check common:sendSubscriptionMessage(wsClient1, document, "1"); foreach int i in 1 ..< 4 { json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); } } worker B returns error? { - check sendSubscriptionMessage(wsClient2, document, "2"); + check common:sendSubscriptionMessage(wsClient2, document, "2"); foreach int i in 1 ..< 4 { json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); } } - check sendSubscriptionMessage(wsClient3, document, "3"); + check common:sendSubscriptionMessage(wsClient3, document, "3"); foreach int i in 1 ..< 4 { json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check validateNextMessage(wsClient3, expectedMsgPayload, id = "3"); + check common:validateNextMessage(wsClient3, expectedMsgPayload, id = "3"); } check wait A; check wait B; @@ -312,17 +313,17 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns er groups: ["interceptors", "union", "subscriptions"] } isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns error? { - final string document = check getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); - string url = "ws://localhost:9099/subscription_interceptor4"; + final string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); + string url = "ws://localhost:9091/subscription_interceptor4"; websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; final websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); + check common:initiateGraphqlWsConnection(wsClient1); final websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); + check common:initiateGraphqlWsConnection(wsClient2); worker A returns error? { - check sendSubscriptionMessage(wsClient1, document, "1", operationName = "unionTypes1"); + check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "unionTypes1"); json expectedMsgPayload = { data: { multipleValues1: { @@ -331,7 +332,7 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns er } } }; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); expectedMsgPayload = { data: { multipleValues1: { @@ -340,10 +341,10 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns er } } }; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); } worker B returns error? { - check sendSubscriptionMessage(wsClient2, document, "2", operationName = "unionTypes1"); + check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "unionTypes1"); json expectedMsgPayload = { data: { multipleValues1: { @@ -352,7 +353,7 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns er } } }; - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); expectedMsgPayload = { data: { multipleValues1: { @@ -361,7 +362,7 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns er } } }; - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); } check wait A; check wait B; diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/02_interceptors_with_server_cache.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/02_interceptors_with_server_cache.bal new file mode 100644 index 000000000..1ecf08d4f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/02_interceptors_with_server_cache.bal @@ -0,0 +1,54 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; + +@test:Config { + groups: ["server_cache", "interceptors"], + dataProvider: dataProviderServerCacheWithInterceptors +} +isolated function testServerSideCacheWithInterceptors(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/field_caching_with_interceptors"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } +} + +@test:Config { + groups: ["server_cache", "interceptor"], + dataProvider: dataProviderServerCacheWithInterceptors +} +isolated function testServerSideCacheWithInterceptorInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { + string url = "http://localhost:9090/caching_with_interceptor_operations"; + string document = check common:getGraphqlDocumentFromFile(documentFile); + foreach int i in 0 ..< resourceFileNames.length() { + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationNames[i]); + json expectedPayload = check common:getJsonContentFromFile(resourceFileNames[i]); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); + } +} + +function dataProviderServerCacheWithInterceptors() returns map<[string, string[], json, string[]]> { + map<[string, string[], json, string[]]> dataSet = { + "1": ["server_cache_with_interceptors", ["server_cache_with_interceptors_1", "server_cache_with_interceptors_2", "server_cache_with_interceptors_1"], (), ["A", "B", "A"]], + "2": ["server_cache_eviction_with_interceptors", ["server_cache_with_interceptors_1", "server_cache_with_interceptors_2", "server_cache_with_interceptors_3"], (), ["A", "B", "A"]] + }; + return dataSet; +} diff --git a/ballerina-tests/tests/interceptors.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal similarity index 99% rename from ballerina-tests/tests/interceptors.bal rename to ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal index 477c9419c..8cf3637aa 100644 --- a/ballerina-tests/tests/interceptors.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal @@ -312,7 +312,6 @@ readonly service class HierarchicalPath2 { } } - @graphql:InterceptorConfig { global: false } diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/listeners.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/listeners.bal new file mode 100644 index 000000000..f9e09624a --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/listeners.bal @@ -0,0 +1,20 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener basicListener = new (9090); +listener graphql:Listener subscriptionListener = new (9091); diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/object_types.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/object_types.bal new file mode 100644 index 000000000..3fe8024fa --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/object_types.bal @@ -0,0 +1,171 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +public type PeopleService StudentService|TeacherService; + +public distinct isolated service class StudentService { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } +} + +public distinct isolated service class TeacherService { + private final int id; + private string name; + private string subject; + + public isolated function init(int id, string name, string subject) { + self.id = id; + self.name = name; + self.subject = subject; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + isolated function setName(string name) { + lock { + self.name = name; + } + } + + isolated resource function get subject() returns string { + lock { + return self.subject; + } + } + + isolated function setSubject(string subject) { + lock { + self.subject = subject; + } + } + + isolated resource function get holidays() returns Weekday[] { + return [SATURDAY, SUNDAY]; + } + + isolated resource function get school() returns School { + return new School("CHEM"); + } +} + +public distinct isolated service class School { + private string name; + + public isolated function init(string name) { + self.name = name; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + # Get the opening days of the school. + # + return - The set of the weekdays the school is open + # # Deprecated + # School is now online. + @deprecated + isolated resource function get openingDays() returns Weekday[] { + return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; + } +} + +public distinct isolated service class Customer { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + @graphql:ResourceConfig { + interceptors: [new Counter(), new Counter(), new Counter()] + } + isolated resource function get id() returns int { + return self.id; + } + + @graphql:ResourceConfig { + interceptors: new NullReturn1() + } + isolated resource function get name() returns string? { + lock { + return self.name; + } + } + + isolated resource function get address() returns CustomerAddress { + return new (225, "Bakers street", "London"); + } +} + +public distinct isolated service class CustomerAddress { + private final int number; + private final string street; + private final string city; + + public isolated function init(int number, string street, string city) { + self.number = number; + self.street = street; + self.city = city; + } + + @graphql:ResourceConfig { + interceptors: [new Counter(), new Counter()] + } + isolated resource function get number() returns int { + return self.number; + } + + @graphql:ResourceConfig { + interceptors: new Street() + } + isolated resource function get street() returns string { + return self.street; + } + + @graphql:ResourceConfig { + interceptors: new City() + } + isolated resource function get city() returns string { + return self.city; + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/records.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/records.bal new file mode 100644 index 000000000..8510f3981 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/records.bal @@ -0,0 +1,58 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +type Employee readonly & record {| + readonly int id; + string name; + decimal salary; +|}; + +public type Person readonly & record { + string name; + int age?; + Address address; +}; + +public type Address readonly & record { + string number; + string street; + string city; +}; + +public type Book readonly & record { + string name; + string author; +}; + +public type Contact readonly & record { + string number; +}; + +public type Languages record {| + map name; +|}; + +type EmployeeTable table key(id); + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/duplicate_interceptors.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/duplicate_interceptors.graphql new file mode 100644 index 000000000..80de5305f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/duplicate_interceptors.graphql @@ -0,0 +1,3 @@ +{ + age +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/execute_same_interceptor_multiple_times.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/execute_same_interceptor_multiple_times.graphql new file mode 100644 index 000000000..80de5305f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/execute_same_interceptor_multiple_times.graphql @@ -0,0 +1,3 @@ +{ + age +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptor_execution_order.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptor_execution_order.graphql new file mode 100644 index 000000000..aa621d36c --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptor_execution_order.graphql @@ -0,0 +1,4 @@ +{ + quote + status +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors.graphql new file mode 100644 index 000000000..4ebc06dd0 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors.graphql @@ -0,0 +1,3 @@ +{ + enemy +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error1.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error1.graphql new file mode 100644 index 000000000..309d965a6 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error1.graphql @@ -0,0 +1,3 @@ +{ + greet +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error2.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error2.graphql new file mode 100644 index 000000000..ddcc86579 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error2.graphql @@ -0,0 +1,3 @@ +{ + friends +} diff --git a/ballerina-tests/tests/resources/documents/interceptors_returning_invalid_value.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error3.graphql similarity index 58% rename from ballerina-tests/tests/resources/documents/interceptors_returning_invalid_value.graphql rename to ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error3.graphql index 223a09cc4..ea4ec4c79 100644 --- a/ballerina-tests/tests/resources/documents/interceptors_returning_invalid_value.graphql +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_error3.graphql @@ -1,4 +1,6 @@ { + person { name age + } } diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql new file mode 100644 index 000000000..9a8094c82 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql @@ -0,0 +1,9 @@ +{ + name + age + address { + city + street + number + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_invalid_value.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_invalid_value.graphql new file mode 100644 index 000000000..76e86672d --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_returning_invalid_value.graphql @@ -0,0 +1,4 @@ +{ + name + age +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_arrays.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_arrays.graphql new file mode 100644 index 000000000..e52064d89 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_arrays.graphql @@ -0,0 +1,3 @@ +{ + houses +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification1.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification1.graphql new file mode 100644 index 000000000..233c1208a --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification1.graphql @@ -0,0 +1,11 @@ +{ + students { + id + name + } + teachers { + id + name + subject + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification2.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification2.graphql new file mode 100644 index 000000000..717fb288f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_destructive_modification2.graphql @@ -0,0 +1,10 @@ +{ + students { + id + name + } + teachers { + id + name + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_enum.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_enum.graphql new file mode 100644 index 000000000..81e525295 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_enum.graphql @@ -0,0 +1,3 @@ +{ + holidays +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments.graphql new file mode 100644 index 000000000..258d1d659 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments.graphql @@ -0,0 +1,11 @@ +query { + teacher { + ...data + } +} + +fragment data on TeacherService { + id + name + subject +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql new file mode 100644 index 000000000..23c9030c8 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql @@ -0,0 +1,29 @@ +subscription getStudents { + ...personFieldsA +} + +subscription getNewStudents { + ...personFieldsB +} + +fragment personFieldsA on Subscription { + ...studentFieldsA +} + +fragment studentFieldsA on Subscription { + students { + id + name + } +} + +fragment personFieldsB on Subscription { + ...studentFieldsB +} + +fragment studentFieldsB on Subscription { + newStudents { + id + name + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_hierarchical_paths.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_hierarchical_paths.graphql new file mode 100644 index 000000000..4fa4cae43 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_hierarchical_paths.graphql @@ -0,0 +1,6 @@ +{ + name { + first + last + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql new file mode 100644 index 000000000..80de5305f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql @@ -0,0 +1,3 @@ +{ + age +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql new file mode 100644 index 000000000..ddcc86579 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql @@ -0,0 +1,3 @@ +{ + friends +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql new file mode 100644 index 000000000..3201a2ad3 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql @@ -0,0 +1,8 @@ +{ + person { + name + address { + city + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql new file mode 100644 index 000000000..48312af44 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql @@ -0,0 +1,6 @@ +{ + student { + id + name + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_map.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_map.graphql new file mode 100644 index 000000000..71f59e648 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_map.graphql @@ -0,0 +1,14 @@ +query { + languages { + backend: name(key: "backend") + name(key: "frontend") + data: name(key: "data") + native: name(key: "native") + } + updatedLanguages { + backend: name(key: "backend") + frontend: name(key: "frontend") + data: name(key: "data") + native: name(key: "native") + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_mutation.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_mutation.graphql new file mode 100644 index 000000000..c872b3ad9 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_mutation.graphql @@ -0,0 +1,9 @@ +mutation { + setName(name: "Heisenberg") { + name + } + setAge(age: 14) { + name + age + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value1.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value1.graphql new file mode 100644 index 000000000..97c0e11e8 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value1.graphql @@ -0,0 +1,3 @@ +{ + name +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value2.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value2.graphql new file mode 100644 index 000000000..76e86672d --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_null_value2.graphql @@ -0,0 +1,4 @@ +{ + name + age +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_record_fields.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_record_fields.graphql new file mode 100644 index 000000000..563b404f4 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_record_fields.graphql @@ -0,0 +1,15 @@ +{ + profile { + name + age + address { + number + street + city + } + } + newProfile { + name + age + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records.graphql new file mode 100644 index 000000000..4db0eea3e --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records.graphql @@ -0,0 +1,13 @@ +{ + userProfile: profile { + name + userName: name + homeAddress: address { + number + streetName: street + } + } + contactDetails: contact { + number + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records_and_fragments.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records_and_fragments.graphql new file mode 100644 index 000000000..7bdd4f546 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_records_and_fragments.graphql @@ -0,0 +1,18 @@ +{ + profile { + name + age + ...P1 + } + newProfile { + ...P1 + } +} + +fragment P1 on Person { + address { + number + street + city + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_service_object.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_service_object.graphql new file mode 100644 index 000000000..35214df34 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_service_object.graphql @@ -0,0 +1,11 @@ +{ + teacher { + id + name + subject + } + student { + id + name + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql new file mode 100644 index 000000000..69eb8d408 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql @@ -0,0 +1,13 @@ +subscription A { + books { + name + author + } +} + +subscription B { + newBooks { + name + author + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql new file mode 100644 index 000000000..42ee3e944 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql @@ -0,0 +1,22 @@ +subscription unionTypes1 { + multipleValues1 { + ...StudentFragment + ...TeacherFragment + } +} + +subscription unionTypes2 { + multipleValues2 { + ...TeacherFragment + } +} + +fragment StudentFragment on StudentService { + id + name +} + +fragment TeacherFragment on TeacherService { + name + subject +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_table.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_table.graphql new file mode 100644 index 000000000..1dc47e4fc --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_table.graphql @@ -0,0 +1,8 @@ +{ + employees { + name + } + oldEmployees { + name + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_union.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_union.graphql new file mode 100644 index 000000000..caf70bf5a --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_union.graphql @@ -0,0 +1,15 @@ +{ + profile1(id: 4) { + ... on StudentService { + id + name + } + } + profile2(id: 4) { + ... on TeacherService { + id + name + subject + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/resource_interceptors.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/resource_interceptors.graphql new file mode 100644 index 000000000..e59bf0f1a --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/resource_interceptors.graphql @@ -0,0 +1,14 @@ +query { + customer { + id + name + address { + number + street + city + } + } + newPerson { + name + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_eviction_with_interceptors.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_eviction_with_interceptors.graphql new file mode 100644 index 000000000..3e44d8895 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_eviction_with_interceptors.graphql @@ -0,0 +1,7 @@ +query A { + enemy +} + +mutation B { + updateEnemy(name: "Snape", enableEvict: true) +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_with_interceptors.graphql b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_with_interceptors.graphql new file mode 100644 index 000000000..9b7b9a35b --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/server_cache_with_interceptors.graphql @@ -0,0 +1,7 @@ +query A { + enemy +} + +mutation B { + updateEnemy(name: "Snape", enableEvict: false) +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/duplicate_interceptors.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/duplicate_interceptors.json new file mode 100644 index 000000000..e380f5f09 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/duplicate_interceptors.json @@ -0,0 +1,5 @@ +{ + "data": { + "age": 29 + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/execute_same_interceptor_multiple_times.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/execute_same_interceptor_multiple_times.json new file mode 100644 index 000000000..e380f5f09 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/execute_same_interceptor_multiple_times.json @@ -0,0 +1,5 @@ +{ + "data": { + "age": 29 + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptor_execution_order.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptor_execution_order.json new file mode 100644 index 000000000..dfc1db1dd --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptor_execution_order.json @@ -0,0 +1,6 @@ +{ + "data": { + "quote": "Ballerina is an open-source programming language.", + "status": "Ballerina is a powerful general-purpose programming language." + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors.json new file mode 100644 index 000000000..50f6bf3f8 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors.json @@ -0,0 +1,5 @@ +{ + "data": { + "enemy": "Harry Potter and the Chamber of Secrets --> Tom Marvolo Riddle - voldemort" + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error1.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error1.json new file mode 100644 index 000000000..db14a47d3 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error1.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "This field is not accessible!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["greet"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error2.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error2.json new file mode 100644 index 000000000..5f496a1fc --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error2.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "This field is not accessible!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["friends"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error3.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error3.json new file mode 100644 index 000000000..b1fce1fe8 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_error3.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "This field is not accessible!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["person"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json new file mode 100644 index 000000000..c769cd946 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json @@ -0,0 +1,33 @@ +{ + "errors": [ + { + "message": "Access denied!", + "locations": [{ "line": 3, "column": 3 }], + "path": ["age"] + }, + { + "message": "This field is not accessible!", + "locations": [{ "line": 5, "column": 5 }], + "path": ["address", "city"] + }, + { + "message": "Access denied!", + "locations": [{ "line": 6, "column": 5 }], + "path": ["address", "street"] + }, + { + "message": "Access denied!", + "locations": [{ "line": 7, "column": 5 }], + "path": ["address", "number"] + } + ], + "data": { + "name": "Walter", + "age": null, + "address": { + "city": null, + "street": null, + "number": null + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_invalid_value.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_invalid_value.json new file mode 100644 index 000000000..868461783 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_returning_invalid_value.json @@ -0,0 +1,15 @@ +{ + "errors": [ + { + "message": "Invalid return type in Interceptor \"NullReturn1\". Expected type String!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["name"] + }, + { + "message": "Invalid return type in Interceptor \"NullReturn2\". Expected type Int!", + "locations": [{ "line": 3, "column": 3 }], + "path": ["age"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_arrays.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_arrays.json new file mode 100644 index 000000000..10b2fe06b --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_arrays.json @@ -0,0 +1,10 @@ +{ + "data": { + "houses": [ + "Gryffindor(Fire)", + "Hufflepuff(Earth)", + "Ravenclaw(Air)", + "Slytherin(Water)" + ] + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification1.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification1.json new file mode 100644 index 000000000..071e7d028 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification1.json @@ -0,0 +1,8 @@ +{ + "data": { + "students": [{ "id": 3, "name": "Minerva McGonagall" }], + "teachers": [ + { "id": 46, "name": "Sybill Trelawney", "subject": "Divination" } + ] + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification2.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification2.json new file mode 100644 index 000000000..9acc66838 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_destructive_modification2.json @@ -0,0 +1,6 @@ +{ + "data": { + "students": ["Ballerina", "GraphQL"], + "teachers": ["Hello", "World!"] + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_enum.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_enum.json new file mode 100644 index 000000000..f4dbb8240 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_enum.json @@ -0,0 +1,5 @@ +{ + "data": { + "holidays": ["SATURDAY", "SUNDAY", "MONDAY", "TUESDAY"] + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_fragments.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_fragments.json new file mode 100644 index 000000000..8fb106e8f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_fragments.json @@ -0,0 +1,9 @@ +{ + "data": { + "teacher": { + "id": 3, + "name": "Minerva McGonagall", + "subject": "Transfiguration" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_hierarchical_paths.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_hierarchical_paths.json new file mode 100644 index 000000000..9770fc6c5 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_hierarchical_paths.json @@ -0,0 +1,8 @@ +{ + "data": { + "name": { + "first": "Harry", + "last": "Potter" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json new file mode 100644 index 000000000..f7369b8d7 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json @@ -0,0 +1,25 @@ +{ + "errors": [ + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor9\". Expected type Int!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["age"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor8\". Expected type Int!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["age"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor2\". Expected type Int!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["age"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor1\". Expected type Int!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["age"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json new file mode 100644 index 000000000..69263796f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json @@ -0,0 +1,20 @@ +{ + "errors": [ + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor8\". Expected type [String!]!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["friends"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor4\". Expected type [String!]!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["friends"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor3\". Expected type [String!]!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["friends"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json new file mode 100644 index 000000000..81966a5e8 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json @@ -0,0 +1,25 @@ +{ + "errors": [ + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor9\". Expected type Person!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["person"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor6\". Expected type Person!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["person"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor5\". Expected type Person!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["person"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor6\". Expected type Address!", + "locations": [{ "line": 4, "column": 5 }], + "path": ["person", "address"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json new file mode 100644 index 000000000..62043b182 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json @@ -0,0 +1,20 @@ +{ + "errors": [ + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor9\". Expected type StudentService!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["student"] + }, + { + "message": "Invalid return type in Interceptor \"InvalidInterceptor7\". Expected type String!", + "locations": [{ "line": 4, "column": 5 }], + "path": ["student", "name"] + } + ], + "data": { + "student": { + "id": 5, + "name": "Jessie" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_map.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_map.json new file mode 100644 index 000000000..b7614cabf --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_map.json @@ -0,0 +1,16 @@ +{ + "data": { + "languages": { + "backend": "Java", + "name": "Flutter", + "data": "Ballerina", + "native": "C#" + }, + "updatedLanguages": { + "backend": "PHP", + "frontend": "JavaScript", + "data": "Python", + "native": "C#" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_mutation.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_mutation.json new file mode 100644 index 000000000..1eaae9fee --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_mutation.json @@ -0,0 +1,11 @@ +{ + "data": { + "setName": { + "name": "Albus Percival Wulfric Brian Dumbledore" + }, + "setAge": { + "name": "Albert", + "age": 53 + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value1.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value1.json new file mode 100644 index 000000000..a76591a69 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value1.json @@ -0,0 +1,5 @@ +{ + "data": { + "name": null + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value2.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value2.json new file mode 100644 index 000000000..7dd9bc79a --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_null_value2.json @@ -0,0 +1,6 @@ +{ + "data": { + "name": null, + "age": null + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_record_fields.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_record_fields.json new file mode 100644 index 000000000..9ae76ac20 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_record_fields.json @@ -0,0 +1,21 @@ +{ + "errors": [ + { + "message": "Access denied!", + "locations": [{ "line": 11, "column": 3 }], + "path": ["newProfile"] + } + ], + "data": { + "profile": { + "name": "Albus Percival Wulfric Brian Dumbledore", + "age": 80, + "address": { + "number": "100", + "street": "Margo Street", + "city": "London" + } + }, + "newProfile": null + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records.json new file mode 100644 index 000000000..10f8c113f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records.json @@ -0,0 +1,15 @@ +{ + "data": { + "userProfile": { + "name": "Rubeus Hagrid", + "userName": "Rubeus Hagrid", + "homeAddress": { + "number": "103", + "streetName": "Mould-on-the-Wold" + } + }, + "contactDetails": { + "number": "+87654321" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records_and_fragments.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records_and_fragments.json new file mode 100644 index 000000000..1d2ef2a60 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_records_and_fragments.json @@ -0,0 +1,21 @@ +{ + "errors": [ + { + "message": "Access denied!", + "locations": [{ "line": 7, "column": 3 }], + "path": ["newProfile"] + } + ], + "data": { + "profile": { + "name": "Albus Percival Wulfric Brian Dumbledore", + "age": 80, + "address": { + "number": "100", + "street": "Margo Street", + "city": "London" + } + }, + "newProfile": null + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_service_object.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_service_object.json new file mode 100644 index 000000000..982c68712 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_service_object.json @@ -0,0 +1,13 @@ +{ + "data": { + "teacher": { + "id": 3, + "name": "Minerva McGonagall", + "subject": "Transfiguration" + }, + "student": { + "id": 45, + "name": "Ron Weasley" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_table.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_table.json new file mode 100644 index 000000000..410e23fe4 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_table.json @@ -0,0 +1,14 @@ +{ + "data": { + "employees": [ + { "name": "Eng. John Doe" }, + { "name": "Eng. Jane Doe" }, + { "name": "Eng. Johnny Roe" } + ], + "oldEmployees": [ + { "name": "John" }, + { "name": "Jane" }, + { "name": "Johnny" } + ] + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_union.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_union.json new file mode 100644 index 000000000..831ff7b4f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/interceptors_with_union.json @@ -0,0 +1,13 @@ +{ + "data": { + "profile1": { + "id": 3, + "name": "Minerva McGonagall" + }, + "profile2": { + "id": 4, + "name": "Minerva McGonagall", + "subject": "Black Magic" + } + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/resource_interceptors.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/resource_interceptors.json new file mode 100644 index 000000000..debf5c09b --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/resource_interceptors.json @@ -0,0 +1,21 @@ +{ + "errors": [ + { + "message": "Access denied!", + "locations": [{ "line": 11, "column": 3 }], + "path": ["newPerson"] + } + ], + "data": { + "customer": { + "id": 4, + "name": null, + "address": { + "number": 227, + "street": "Street 3", + "city": "New York" + } + }, + "newPerson": null + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_1.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_1.json new file mode 100644 index 000000000..b8ec852fc --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "enemy": "Tom Marvolo Riddle - voldemort" + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_2.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_2.json new file mode 100644 index 000000000..9f42d0bb3 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "updateEnemy": "Snape" + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_3.json b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_3.json new file mode 100644 index 000000000..018a12093 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/resources/expected_results/server_cache_with_interceptors_3.json @@ -0,0 +1,5 @@ +{ + "data": { + "enemy": "Tom Marvolo Riddle - Snape" + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal new file mode 100644 index 000000000..2f4bbe263 --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal @@ -0,0 +1,662 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +@graphql:ServiceConfig { + interceptors: [new StringInterceptor4(), new StringInterceptor5(), new StringInterceptor6()] +} +service /intercept_string on basicListener { + @graphql:ResourceConfig { + interceptors: [new StringInterceptor1(), new StringInterceptor2(), new StringInterceptor3()] + } + resource function get enemy() returns string { + return "voldemort"; + } +} + +@graphql:ServiceConfig { + interceptors: [new Counter(), new Counter(), new Counter()] +} +service /intercept_int on basicListener { + @graphql:ResourceConfig { + interceptors: [new Counter(), new Counter(), new Counter()] + } + isolated resource function get age() returns int { + return 23; + } +} + +@graphql:ServiceConfig { + interceptors: [new RecordInterceptor1(), new LogSubfields()] +} +service /intercept_records on basicListener { + isolated resource function get profile() returns Person { + return { + name: "Albus Percival Wulfric Brian Dumbledore", + age: 80, + address: {number: "101", street: "Mould-on-the-Wold", city: "London"} + }; + } + + @graphql:ResourceConfig { + interceptors: new RecordInterceptor2() + } + isolated resource function get contact() returns Contact { + return { + number: "+12345678" + }; + } +} + +@graphql:ServiceConfig { + interceptors: [new HierarchicalPath1(), new HierarchicalPath3()] +} +service /intercept_hierarchical on basicListener { + @graphql:ResourceConfig { + interceptors: new HierarchicalPath2() + } + isolated resource function get name/first() returns string { + return "Sherlock"; + } + + isolated resource function get name/last() returns string { + return "Holmes"; + } +} + +@graphql:ServiceConfig { + interceptors: new Destruct1() +} +service /intercept_service_obj_array1 on basicListener { + resource function get students() returns StudentService[] { + return [new StudentService(45, "Ron Weasly"), new StudentService(46, "Hermione Granger")]; + } + + @graphql:ResourceConfig { + interceptors: [new Destruct2()] + } + resource function get teachers() returns TeacherService[] { + TeacherService t1 = new TeacherService(45, "Severus Snape", "Defence Against the Dark Arts"); + return [t1]; + } +} + +@graphql:ServiceConfig { + interceptors: new ServiceObjectInterceptor1() +} +service /intercept_service_obj on basicListener { + resource function get teacher() returns TeacherService { + return new TeacherService(2, "Severus Snape", "Defence Against the Dark Arts"); + } + + @graphql:ResourceConfig { + interceptors: [new ServiceObjectInterceptor3()] + } + resource function get student() returns StudentService { + return new StudentService(1, "Harry Potter"); + } +} + +@graphql:ServiceConfig { + interceptors: new ServiceObjectInterceptor2() +} +service /intercept_service_obj_array2 on basicListener { + resource function get students() returns StudentService[] { + return [new StudentService(45, "Ron Weasly"), new StudentService(46, "Hermione Granger")]; + } + + @graphql:ResourceConfig { + interceptors: [new ServiceObjectInterceptor4()] + } + resource function get teachers() returns TeacherService[] { + return [new TeacherService(2, "Severus Snape", "Defence Against the Dark Arts")]; + } +} + +@graphql:ServiceConfig { + interceptors: new ArrayInterceptor1() +} +service /intercept_arrays on basicListener { + @graphql:ResourceConfig { + interceptors: new ArrayInterceptor2() + } + resource function get houses() returns string[] { + return ["Gryffindor(Fire)", "Hufflepuff(Earth)"]; + } +} + +@graphql:ServiceConfig { + interceptors: new EnumInterceptor1() +} +service /intercept_enum on basicListener { + @graphql:ResourceConfig { + interceptors: [new EnumInterceptor2()] + } + isolated resource function get holidays() returns Weekday[] { + return []; + } +} + +@graphql:ServiceConfig { + interceptors: new UnionInterceptor1() +} +service /intercept_unions on basicListener { + isolated resource function get profile1(int id) returns StudentService|TeacherService { + if id < 100 { + return new StudentService(1, "Jesse Pinkman"); + } + return new TeacherService(737, "Walter White", "Chemistry"); + } + + @graphql:ResourceConfig { + interceptors: new UnionInterceptor2() + } + isolated resource function get profile2(int id) returns StudentService|TeacherService { + if id > 100 { + return new StudentService(1, "Jesse Pinkman"); + } + return new TeacherService(737, "Walter White", "Chemistry"); + } +} + +@graphql:ServiceConfig { + interceptors: [new RecordFieldInterceptor1(), new RecordFieldInterceptor2(), new ServiceLevelInterceptor(), new RecordFieldInterceptor3()] +} +service /intercept_record_fields on basicListener { + isolated resource function get profile() returns Person { + return { + name: "Rubeus Hagrid", + age: 70, + address: {number: "103", street: "Mould-on-the-Wold", city: "London"} + }; + } + + isolated resource function get newProfile() returns Person? { + return { + name: "Rubeus Hagrid", + age: 70, + address: {number: "103", street: "Mould-on-the-Wold", city: "London"} + }; + } +} + +@graphql:ServiceConfig { + interceptors: new MapInterceptor1() +} +service /intercept_map on basicListener { + private final Languages languages; + + function init() { + self.languages = { + name: { + backend: "Ballerina", + frontend: "JavaScript", + data: "Python", + native: "C++" + } + }; + } + + isolated resource function get languages() returns Languages { + return self.languages; + } + + @graphql:ResourceConfig { + interceptors: new MapInterceptor2() + } + isolated resource function get updatedLanguages() returns Languages { + return { + name: { + backend: "Ruby", + frontend: "Java", + data: "Ballerina", + native: "C++" + } + }; + } +} + +@graphql:ServiceConfig { + interceptors: new TableInterceptor1() +} +service /intercept_table on basicListener { + isolated resource function get employees() returns EmployeeTable? { + return employees; + } + + @graphql:ResourceConfig { + interceptors: new TableInterceptor2() + } + isolated resource function get oldEmployees() returns EmployeeTable? { + return employees; + } +} + +@graphql:ServiceConfig { + interceptors: [new InterceptMutation1(), new ServiceLevelInterceptor()] +} +isolated service /mutation_interceptor on basicListener { + private Person p; + + isolated function init() { + self.p = p2.clone(); + } + + isolated resource function get person() returns Person { + lock { + return self.p; + } + } + + isolated remote function setName(string name) returns Person { + lock { + Person p = {name: name, age: self.p.age, address: self.p.address}; + self.p = p; + return self.p; + } + } + + @graphql:ResourceConfig { + interceptors: new InterceptMutation2() + } + isolated remote function setAge(int age) returns Person { + lock { + Person p = {name: self.p.name, age: age, address: self.p.address}; + self.p = p; + return self.p; + } + } + + isolated resource function get customer() returns Customer { + return new (1, "Sherlock"); + } + + isolated resource function get newPerson() returns Person? { + lock { + return self.p; + } + } +} + +@graphql:ServiceConfig { + interceptors: new ErrorInterceptor1() +} +service /intercept_errors1 on basicListener { + isolated resource function get greet() returns string|error { + return error("This is an invalid field!"); + } +} + +@graphql:ServiceConfig { + interceptors: [new ErrorInterceptor1()] +} +service /intercept_errors2 on basicListener { + isolated resource function get friends() returns string[] { + return ["Harry", "Ron", "Hermione"]; + } +} + +@graphql:ServiceConfig { + interceptors: new ErrorInterceptor1() +} +service /intercept_errors3 on basicListener { + isolated resource function get person() returns Person { + return { + name: "Albus Percival Wulfric Brian Dumbledore", + age: 80, + address: {number: "101", street: "Mould-on-the-Wold", city: "London"} + }; + } +} + +@graphql:ServiceConfig { + interceptors: [new Execution1(), new Execution2()], + contextInit: + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("subject", "Ballerina"); + context.set("beVerb", "is"); + context.set("object", "purpose"); + return context; + } +} +service /intercept_order on basicListener { + isolated resource function get quote() returns string { + return "an open-source"; + } + + @graphql:ResourceConfig { + interceptors: [new Execution3(), new Execution4()] + } + isolated resource function get status() returns string { + return "general"; + } +} + +@graphql:ServiceConfig { + interceptors: new AccessGrant() +} +service /intercept_erros_with_hierarchical on basicListener { + resource function get name() returns string { + return "Walter"; + } + + resource function get age() returns int? { + return 67; + } + + resource function get address/number() returns int? { + return 221; + } + + resource function get address/street() returns string? { + return "Main Street"; + } + + @graphql:ResourceConfig { + interceptors: new ErrorInterceptor1() + } + resource function get address/city() returns string? { + return "London"; + } +} + +@graphql:ServiceConfig { + interceptors: new RecordInterceptor1() +} +service /interceptors_with_null_values1 on basicListener { + resource function get name() returns string? { + return; + } +} + +@graphql:ServiceConfig { + interceptors: new NullReturn1() +} +service /interceptors_with_null_values2 on basicListener { + resource function get name() returns string? { + return "Ballerina"; + } + + @graphql:ResourceConfig { + interceptors: new NullReturn2() + } + resource function get age() returns int? { + return 44; + } +} + +@graphql:ServiceConfig { + interceptors: new NullReturn1() +} +service /interceptors_with_null_values3 on basicListener { + resource function get name() returns string { + return "Ballerina"; + } + + @graphql:ResourceConfig { + interceptors: new NullReturn2() + } + resource function get age() returns int { + return 44; + } +} + +@graphql:ServiceConfig { + interceptors: [new InvalidInterceptor1(), new InvalidInterceptor2()] +} +service /invalid_interceptor1 on basicListener { + @graphql:ResourceConfig { + interceptors: [new InvalidInterceptor8(), new InvalidInterceptor9()] + } + isolated resource function get age() returns int { + return 23; + } +} + +@graphql:ServiceConfig { + interceptors: [new InvalidInterceptor3(), new InvalidInterceptor4()] +} +service /invalid_interceptor2 on basicListener { + @graphql:ResourceConfig { + interceptors: new InvalidInterceptor8() + } + isolated resource function get friends() returns string[] { + return ["Harry", "Ron", "Hermione"]; + } +} + +@graphql:ServiceConfig { + interceptors: [new InvalidInterceptor5(), new InvalidInterceptor6()] +} +service /invalid_interceptor3 on basicListener { + @graphql:ResourceConfig { + interceptors: new InvalidInterceptor9() + } + isolated resource function get person() returns Person { + return { + name: "Albus Percival Wulfric Brian Dumbledore", + age: 80, + address: {number: "101", street: "Mould-on-the-Wold", city: "London"} + }; + } +} + +@graphql:ServiceConfig { + interceptors: new InvalidInterceptor7() +} +service /invalid_interceptor4 on basicListener { + @graphql:ResourceConfig { + interceptors: new InvalidInterceptor9() + } + resource function get student() returns StudentService { + return new StudentService(45, "Ron Weasly"); + } +} + +@graphql:ServiceConfig { + interceptors: [new DestructiveModification()] +} +isolated service /subscription_interceptor6 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + @graphql:ResourceConfig { + interceptors: new DestructiveModification() + } + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: new ReturnBeforeResolver() +} +isolated service /subscription_interceptor5 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: [new Subtraction(), new Multiplication()] +} +isolated service /subscription_interceptor1 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + @graphql:ResourceConfig { + interceptors: [new Subtraction(), new Multiplication()] + } + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: [new InterceptAuthor(), new ServiceLevelInterceptor()] +} +isolated service /subscription_interceptor2 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe books() returns stream { + Book?[] books = [ + {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, + {name: "A Game of Thrones", author: "George R.R. Martin"}, + () + ]; + return books.toStream(); + } + + @graphql:ResourceConfig { + interceptors: [new InterceptBook()] + } + isolated resource function subscribe newBooks() returns stream { + Book?[] books = [ + {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, + () + ]; + return books.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: new InterceptStudentName() +} +isolated service /subscription_interceptor3 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe students() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } + + @graphql:ResourceConfig { + interceptors: [new InterceptStudent()] + } + isolated resource function subscribe newStudents() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: new InterceptUnionType1() +} +isolated service /subscription_interceptor4 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe multipleValues1() returns stream|error { + StudentService s = new StudentService(1, "Jesse Pinkman"); + TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); + return [s, t].toStream(); + } + + @graphql:ResourceConfig { + interceptors: new InterceptUnionType2() + } + isolated resource function subscribe multipleValues2() returns stream|error { + StudentService s = new StudentService(1, "Harry Potter"); + TeacherService t = new TeacherService(3, "Severus Snape", "Dark Arts"); + return [s, t].toStream(); + } +} + +service /field_caching_with_interceptors on basicListener { + private string enemy = "voldemort"; + private string friend = "Harry"; + + @graphql:ResourceConfig { + interceptors: [new StringInterceptor1(), new StringInterceptor2(), new StringInterceptor3()], + cacheConfig: { + enabled: true, + maxAge: 15 + } + } + resource function get enemy() returns string { + return self.enemy; + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true, + maxAge: 10 + } + } + resource function get friend() returns string { + return self.friend; + } + + remote function updateEnemy(graphql:Context context, string name, boolean enableEvict) returns string|error { + if enableEvict { + check context.invalidate("enemy"); + } + self.enemy = name; + return self.enemy; + } + + remote function updateFriend(string name) returns string|error { + self.friend = name; + return self.friend; + } +} + +@graphql:ServiceConfig { + cacheConfig: { + enabled: true + } +} +service /caching_with_interceptor_operations on basicListener { + private string name = "voldemort"; + + @graphql:ResourceConfig { + interceptors: [new StringInterceptor1(), new StringInterceptor2(), new StringInterceptor3()] + } + resource function get enemy() returns string { + return self.name; + } + + remote function updateEnemy(graphql:Context context, string name, boolean enableEvict) returns string|error { + if enableEvict { + check context.invalidate("enemy"); + } + self.name = name; + return self.name; + } +} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal new file mode 100644 index 000000000..438e4e88f --- /dev/null +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal @@ -0,0 +1,35 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; + +final readonly & Person p2 = { + name: "Walter White", + age: 50, + address: a2 +}; + +final readonly & Address a2 = { + number: "308", + street: "Negra Arroyo Lane", + city: "Albuquerque" +}; + +final readonly & EmployeeTable employees = table [ + {id: 1, name: "John Doe", salary: 1000.00}, + {id: 2, name: "Jane Doe", salary: 2000.00}, + {id: 3, name: "Johnny Roe", salary: 500.00} +]; diff --git a/ballerina-tests/tests/18_auth_listener_configs.bal b/ballerina-tests/graphql-security-test-suite/tests/01_auth_listener_configs.bal similarity index 59% rename from ballerina-tests/tests/18_auth_listener_configs.bal rename to ballerina-tests/graphql-security-test-suite/tests/01_auth_listener_configs.bal index c444d4c47..a8ea93374 100644 --- a/ballerina-tests/tests/18_auth_listener_configs.bal +++ b/ballerina-tests/graphql-security-test-suite/tests/01_auth_listener_configs.bal @@ -22,84 +22,84 @@ import ballerina/test; groups: ["auth"] } isolated function testNoAuthServiceSuccess() { - assertSuccess(sendBearerTokenRequest(9096, "/noAuth", JWT1)); - assertSuccess(sendJwtRequest(9096, "/noAuth")); + assertSuccess(sendBearerTokenRequest(9090, "/noAuth", JWT1)); + assertSuccess(sendJwtRequest(9090, "/noAuth")); } @test:Config { groups: ["auth"] } isolated function testBasicAuthServiceAuthSuccess() { - assertSuccess(sendBasicTokenRequest(9096, "/basicAuth", "alice", "xxx")); + assertSuccess(sendBasicTokenRequest(9090, "/basicAuth", "alice", "xxx")); } @test:Config { groups: ["auth"] } isolated function testBasicAuthServiceAuthzFailure() { - assertForbidden(sendBasicTokenRequest(9096, "/basicAuth", "bob", "yyy")); + assertForbidden(sendBasicTokenRequest(9090, "/basicAuth", "bob", "yyy")); } @test:Config { groups: ["auth"] } isolated function testBasicAuthServiceAuthnFailure() { - assertUnauthorized(sendBasicTokenRequest(9096, "/basicAuth", "peter", "123")); - assertUnauthorized(sendNoTokenRequest(9096, "/basicAuth")); + assertUnauthorized(sendBasicTokenRequest(9090, "/basicAuth", "peter", "123")); + assertUnauthorized(sendNoTokenRequest(9090, "/basicAuth")); } @test:Config { groups: ["auth"] } isolated function testJwtAuthServiceAuthSuccess() { - assertSuccess(sendBearerTokenRequest(9096, "/jwtAuth", JWT1)); - assertSuccess(sendJwtRequest(9096, "/jwtAuth")); + assertSuccess(sendBearerTokenRequest(9090, "/jwtAuth", JWT1)); + assertSuccess(sendJwtRequest(9090, "/jwtAuth")); } @test:Config { groups: ["auth"] } isolated function testJwtAuthServiceAuthzFailure() { - assertForbidden(sendBearerTokenRequest(9096, "/jwtAuth", JWT2)); + assertForbidden(sendBearerTokenRequest(9090, "/jwtAuth", JWT2)); } @test:Config { groups: ["auth"] } isolated function testJwtAuthServiceAuthnFailure() { - assertUnauthorized(sendBearerTokenRequest(9096, "/jwtAuth", JWT3)); - assertUnauthorized(sendNoTokenRequest(9096, "/jwtAuth")); + assertUnauthorized(sendBearerTokenRequest(9090, "/jwtAuth", JWT3)); + assertUnauthorized(sendNoTokenRequest(9090, "/jwtAuth")); } @test:Config { groups: ["auth"] } isolated function testOAuth2ServiceAuthSuccess() { - assertSuccess(sendBearerTokenRequest(9096, "/oauth2", ACCESS_TOKEN_1)); - assertSuccess(sendOAuth2TokenRequest(9096, "/oauth2")); + assertSuccess(sendBearerTokenRequest(9090, "/oauth2", ACCESS_TOKEN_1)); + assertSuccess(sendOAuth2TokenRequest(9090, "/oauth2")); } @test:Config { groups: ["auth"] } isolated function testOAuth2ServiceAuthzFailure() { - assertForbidden(sendBearerTokenRequest(9096, "/oauth2", ACCESS_TOKEN_2)); + assertForbidden(sendBearerTokenRequest(9090, "/oauth2", ACCESS_TOKEN_2)); } @test:Config { groups: ["auth"] } isolated function testOAuth2ServiceAuthnFailure() { - assertUnauthorized(sendBearerTokenRequest(9096, "/oauth2", ACCESS_TOKEN_3)); - assertUnauthorized(sendNoTokenRequest(9096, "/oauth2")); + assertUnauthorized(sendBearerTokenRequest(9090, "/oauth2", ACCESS_TOKEN_3)); + assertUnauthorized(sendNoTokenRequest(9090, "/oauth2")); } @test:Config { groups: ["auth"] } isolated function testMultipleServiceAuthSuccess() { - assertSuccess(sendBearerTokenRequest(9096, "/multipleAuth", JWT1)); - assertSuccess(sendJwtRequest(9096, "/multipleAuth")); + assertSuccess(sendBearerTokenRequest(9090, "/multipleAuth", JWT1)); + assertSuccess(sendJwtRequest(9090, "/multipleAuth")); } @@ -107,30 +107,30 @@ isolated function testMultipleServiceAuthSuccess() { groups: ["auth"] } isolated function testMultipleServiceAuthzFailure() { - assertForbidden(sendBearerTokenRequest(9096, "/multipleAuth", JWT2)); + assertForbidden(sendBearerTokenRequest(9090, "/multipleAuth", JWT2)); } @test:Config { groups: ["auth"] } isolated function testMultipleServiceAuthnFailure() { - assertUnauthorized(sendBearerTokenRequest(9096, "/multipleAuth", JWT3)); - assertUnauthorized(sendNoTokenRequest(9096, "/multipleAuth")); + assertUnauthorized(sendBearerTokenRequest(9090, "/multipleAuth", JWT3)); + assertUnauthorized(sendNoTokenRequest(9090, "/multipleAuth")); } @test:Config { groups: ["auth"] } isolated function testServiceAuthWithoutScopesAuthSuccess() { - assertSuccess(sendBearerTokenRequest(9096, "/noScopes", JWT1)); - assertSuccess(sendBearerTokenRequest(9096, "/noScopes", JWT2)); - assertSuccess(sendJwtRequest(9096, "/noScopes")); + assertSuccess(sendBearerTokenRequest(9090, "/noScopes", JWT1)); + assertSuccess(sendBearerTokenRequest(9090, "/noScopes", JWT2)); + assertSuccess(sendJwtRequest(9090, "/noScopes")); } @test:Config { groups: ["auth"] } isolated function testServiceAuthWithoutScopesAuthnFailure() { - assertUnauthorized(sendBearerTokenRequest(9096, "/noScopes", JWT3)); - assertUnauthorized(sendNoTokenRequest(9096, "/noScopes")); + assertUnauthorized(sendBearerTokenRequest(9090, "/noScopes", JWT3)); + assertUnauthorized(sendNoTokenRequest(9090, "/noScopes")); } diff --git a/ballerina-tests/graphql-security-test-suite/tests/02_graphiql_secure_endpoint.bal b/ballerina-tests/graphql-security-test-suite/tests/02_graphiql_secure_endpoint.bal new file mode 100644 index 000000000..12fe3ec10 --- /dev/null +++ b/ballerina-tests/graphql-security-test-suite/tests/02_graphiql_secure_endpoint.bal @@ -0,0 +1,42 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/http; +import ballerina/test; + +@test:Config { + groups: ["listener", "graphiql", "auth"] +} +function testGraphiqlClientWithSSL() returns error? { + http:Client clientEP = check new ("https://localhost:9090", + auth = { + username: "alice", + password: "xxx" + }, + secureSocket = { + cert: { + path: TRUSTSTORE_PATH, + password: "ballerina" + } + }, + httpVersion = "1.1" + ); + http:Response|error response = clientEP->get("/graphiql"); + test:assertFalse(response is error); + http:Response graphiqlResponse = check response; + test:assertEquals(graphiqlResponse.getContentType(), common:CONTENT_TYPE_TEXT_HTML); +} diff --git a/ballerina-tests/graphql-security-test-suite/tests/03_client_security.bal b/ballerina-tests/graphql-security-test-suite/tests/03_client_security.bal new file mode 100644 index 000000000..dbb39d7c6 --- /dev/null +++ b/ballerina-tests/graphql-security-test-suite/tests/03_client_security.bal @@ -0,0 +1,42 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/test; + +@test:Config { + groups: ["client", "auth"] +} +isolated function testClientConfiguration() returns error? { + string document = "{ greeting }"; + string url = "https://localhost:9090/basicAuth "; + + graphql:Client graphqlClient = check new (url, + cache = {enabled: true, isShared: true}, + timeout = 1, + http1Settings = {keepAlive: "NEVER"}, + secureSocket = {cert: {path: TRUSTSTORE_PATH, password: "ballerina"}}, + auth = {username: "alice", password: "xxx"}, + poolConfig = {maxActiveConnections: 1}, + circuitBreaker = {statusCodes: [500, 404]}, + retryConfig = {count: 3}, + cookieConfig = {enabled: true} + ); + + json payload = check graphqlClient->execute(document); + json expectedPayload = {data: {greeting: "Hello World!"}}; + test:assertEquals(payload, expectedPayload); +} diff --git a/ballerina-tests/tests/Config.toml b/ballerina-tests/graphql-security-test-suite/tests/Config.toml similarity index 100% rename from ballerina-tests/tests/Config.toml rename to ballerina-tests/graphql-security-test-suite/tests/Config.toml diff --git a/ballerina-tests/graphql-security-test-suite/tests/listeners.bal b/ballerina-tests/graphql-security-test-suite/tests/listeners.bal new file mode 100644 index 000000000..a7e4755ff --- /dev/null +++ b/ballerina-tests/graphql-security-test-suite/tests/listeners.bal @@ -0,0 +1,28 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +listener graphql:Listener secureListener = new (9090, secureSocket = { + key: { + path: KEYSTORE_PATH, + password: "ballerina" + } +}); + +// The mock authorization server, based with https://hub.docker.com/repository/docker/ldclakmal/ballerina-sts +listener http:Listener sts = new (9445, {secureSocket: {key: {path: KEYSTORE_PATH, password: "ballerina"}}}); diff --git a/ballerina-tests/tests/resources/cert/public.crt b/ballerina-tests/graphql-security-test-suite/tests/resources/cert/public.crt similarity index 100% rename from ballerina-tests/tests/resources/cert/public.crt rename to ballerina-tests/graphql-security-test-suite/tests/resources/cert/public.crt diff --git a/ballerina-tests/tests/resources/key/private.key b/ballerina-tests/graphql-security-test-suite/tests/resources/key/private.key similarity index 100% rename from ballerina-tests/tests/resources/key/private.key rename to ballerina-tests/graphql-security-test-suite/tests/resources/key/private.key diff --git a/ballerina-tests/tests/resources/keystore/ballerinaKeystore.p12 b/ballerina-tests/graphql-security-test-suite/tests/resources/keystore/ballerinaKeystore.p12 similarity index 100% rename from ballerina-tests/tests/resources/keystore/ballerinaKeystore.p12 rename to ballerina-tests/graphql-security-test-suite/tests/resources/keystore/ballerinaKeystore.p12 diff --git a/ballerina-tests/tests/resources/keystore/ballerinaTruststore.p12 b/ballerina-tests/graphql-security-test-suite/tests/resources/keystore/ballerinaTruststore.p12 similarity index 100% rename from ballerina-tests/tests/resources/keystore/ballerinaTruststore.p12 rename to ballerina-tests/graphql-security-test-suite/tests/resources/keystore/ballerinaTruststore.p12 diff --git a/ballerina-tests/graphql-security-test-suite/tests/services.bal b/ballerina-tests/graphql-security-test-suite/tests/services.bal new file mode 100644 index 000000000..b9beb16dd --- /dev/null +++ b/ballerina-tests/graphql-security-test-suite/tests/services.bal @@ -0,0 +1,172 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +// Unsecured service +service /noAuth on secureListener { + isolated resource function get greeting() returns string { + return "Hello World!"; + } +} + +// Basic auth secured service +@graphql:ServiceConfig { + auth: [ + { + fileUserStoreConfig: {}, + scopes: ["write", "update"] + } + ], + graphiql: { + enabled: true + } +} +service /basicAuth on secureListener { + isolated resource function get greeting() returns string { + return "Hello World!"; + } +} + +// JWT auth secured service +@graphql:ServiceConfig { + auth: [ + { + jwtValidatorConfig: { + issuer: "wso2", + audience: "ballerina", + signatureConfig: { + trustStoreConfig: { + trustStore: { + path: TRUSTSTORE_PATH, + password: "ballerina" + }, + certAlias: "ballerina" + } + }, + scopeKey: "scp" + }, + scopes: ["write", "update"] + } + ] +} +service /jwtAuth on secureListener { + isolated resource function get greeting() returns string { + return "Hello World!"; + } +} + +// OAuth2 auth secured service +@graphql:ServiceConfig { + auth: [ + { + oauth2IntrospectionConfig: { + url: "https://localhost:9445/oauth2/introspect", + tokenTypeHint: "access_token", + scopeKey: "scp", + clientConfig: { + secureSocket: { + cert: { + path: TRUSTSTORE_PATH, + password: "ballerina" + } + } + } + }, + scopes: ["write", "update"] + } + ] +} +service /oauth2 on secureListener { + isolated resource function get greeting() returns string { + return "Hello World!"; + } +} + +// Testing multiple auth configurations support. +// OAuth2, Basic auth & JWT auth secured service +@graphql:ServiceConfig { + auth: [ + { + oauth2IntrospectionConfig: { + url: "https://localhost:9445/oauth2/introspect", + tokenTypeHint: "access_token", + scopeKey: "scp", + clientConfig: { + secureSocket: { + cert: { + path: TRUSTSTORE_PATH, + password: "ballerina" + } + } + } + }, + scopes: ["write", "update"] + }, + { + fileUserStoreConfig: {}, + scopes: ["write", "update"] + }, + { + jwtValidatorConfig: { + issuer: "wso2", + audience: "ballerina", + signatureConfig: { + trustStoreConfig: { + trustStore: { + path: TRUSTSTORE_PATH, + password: "ballerina" + }, + certAlias: "ballerina" + } + }, + scopeKey: "scp" + }, + scopes: ["write", "update"] + } + ] +} +service /multipleAuth on secureListener { + isolated resource function get greeting() returns string { + return "Hello World!"; + } +} + +// JWT auth secured service (without scopes) +@graphql:ServiceConfig { + auth: [ + { + jwtValidatorConfig: { + issuer: "wso2", + audience: "ballerina", + signatureConfig: { + trustStoreConfig: { + trustStore: { + path: TRUSTSTORE_PATH, + password: "ballerina" + }, + certAlias: "ballerina" + } + } + } + } + ] +} +service /noScopes on secureListener { + isolated resource function get greeting() returns string { + return "Hello World!"; + } +} diff --git a/ballerina-tests/tests/auth_test_utils.bal b/ballerina-tests/graphql-security-test-suite/tests/utils.bal similarity index 96% rename from ballerina-tests/tests/auth_test_utils.bal rename to ballerina-tests/graphql-security-test-suite/tests/utils.bal index d3a4d3566..2405c4c36 100644 --- a/ballerina-tests/tests/auth_test_utils.bal +++ b/ballerina-tests/graphql-security-test-suite/tests/utils.bal @@ -16,6 +16,7 @@ // NOTE: All the tokens/credentials used in this test are dummy tokens/credentials and used only for testing purposes. +import ballerina/graphql_test_common as common; import ballerina/http; import ballerina/test; @@ -217,7 +218,7 @@ isolated function assertForbidden(http:Response|http:ClientError response) { }; json|http:ClientError payload = response.getJsonPayload(); if payload is json { - assertJsonValuesWithOrder(payload, expectedPayload); + common:assertJsonValuesWithOrder(payload, expectedPayload); } else { test:assertFail("Test Failed!"); } @@ -238,7 +239,7 @@ isolated function assertUnauthorized(http:Response|http:ClientError response) { }; json|http:ClientError payload = response.getJsonPayload(); if payload is json { - assertJsonValuesWithOrder(payload, expectedPayload); + common:assertJsonValuesWithOrder(payload, expectedPayload); } else { test:assertFail("Test Failed!"); } @@ -262,10 +263,10 @@ service /oauth2 on sts { isolated resource function post introspect(http:Request request) returns AuthResponse { string|http:ClientError payload = request.getTextPayload(); if payload is string { - string[] parts = re`&`.split(payload); + string[] parts = re `&`.split(payload); foreach string part in parts { if part.indexOf("token=") is int { - string token = re`=`.split(part)[1]; + string token = re `=`.split(part)[1]; if token == ACCESS_TOKEN_1 { return {body: {active: true, exp: 3600, scp: "write update"}}; } else if token == ACCESS_TOKEN_2 { diff --git a/ballerina-tests/custom_prefix_without_import.bal b/ballerina-tests/graphql-service-test-suite/custom_prefix_without_import.bal similarity index 100% rename from ballerina-tests/custom_prefix_without_import.bal rename to ballerina-tests/graphql-service-test-suite/custom_prefix_without_import.bal diff --git a/ballerina-tests/objects.bal b/ballerina-tests/graphql-service-test-suite/object_types.bal similarity index 54% rename from ballerina-tests/objects.bal rename to ballerina-tests/graphql-service-test-suite/object_types.bal index 3c3c27a9a..11c1ca18a 100644 --- a/ballerina-tests/objects.bal +++ b/ballerina-tests/graphql-service-test-suite/object_types.bal @@ -14,8 +14,6 @@ // specific language governing permissions and limitations // under the License. -import ballerina/graphql; - public type Character distinct service object { isolated resource function get name() returns string; }; @@ -263,126 +261,12 @@ public isolated service class ReviewData { isolated resource function get id() returns string => "123"; } -public type Device distinct service object { - isolated resource function get id() returns @graphql:ID int; - - @graphql:ResourceConfig { - complexity: 1 - } - isolated resource function get brand() returns string; - - isolated resource function get model() returns string; - - @graphql:ResourceConfig { - complexity: 4 - } - isolated resource function get price() returns float; -}; - -public isolated distinct service class Phone { - *Device; - - private final int id; - private final string brand; - private final string model; - private final float price; - private final OS os; - private final Device[] connectedDevices; - - isolated function init(int id, string brand, string model, float price, OS os) { - self.id = id; - self.brand = brand; - self.model = model; - self.price = price; - self.os = os; - } - - isolated resource function get id() returns @graphql:ID int => self.id; - - isolated resource function get brand() returns string => self.brand; - - isolated resource function get model() returns string => self.model; - - isolated resource function get price() returns float => self.price; - - isolated resource function get os() returns OS => self.os; -} - -public isolated distinct service class Laptop { - *Device; - - private final int id; - private final string brand; - private final string model; - private final float price; - private final string processor; - private final int ram; - - isolated function init(int id, string brand, string model, float price, string processor, int ram) { - self.id = id; - self.brand = brand; - self.model = model; - self.price = price; - self.processor = processor; - self.ram = ram; - } - - isolated resource function get id() returns @graphql:ID int => self.id; - - isolated resource function get brand() returns string => self.brand; - - isolated resource function get model() returns string => self.model; - - isolated resource function get price() returns float => self.price; - - isolated resource function get processor() returns string => self.processor; - - isolated resource function get ram() returns int => self.ram; -} - -public isolated distinct service class Tablet { - *Device; - - private final int id; - private final string brand; - private final string model; - private final float price; - private final boolean hasCellular; - - isolated function init(int id, string brand, string model, float price, boolean hasCellular) { - self.id = id; - self.brand = brand; - self.model = model; - self.price = price; - self.hasCellular = hasCellular; - } - - isolated resource function get id() returns @graphql:ID int => self.id; - - isolated resource function get brand() returns string => self.brand; - - isolated resource function get model() returns string => self.model; - - isolated resource function get price() returns float => self.price; - - isolated resource function get hasCellular() returns boolean => self.hasCellular; -} - enum OS { iOS, Android, Windows } -type Mobile Phone|Tablet; - -type RatingInput readonly & record {| - string title; - int stars; - string description; - int authorId; -|}; - type RatingData readonly & record {| readonly int id; string title; @@ -390,72 +274,3 @@ type RatingData readonly & record {| string description; int authorId; |}; - -service class Rating { - private final RatingData data; - - isolated function init(RatingData data) { - self.data = data; - } - - isolated resource function get id() returns @graphql:ID int => self.data.id; - - @graphql:ResourceConfig { - complexity: 1 - } - isolated resource function get title() returns string => self.data.title; - - @graphql:ResourceConfig { - complexity: 1 - } - isolated resource function get stars() returns int => self.data.stars; - - isolated resource function get description() returns string => self.data.description; - - @graphql:ResourceConfig { - complexity: 10 - } - isolated resource function get author() returns DeviceUserProfile|error { - lock { - if profileTable.hasKey(self.data.authorId) { - return new DeviceUserProfile(profileTable.get(self.data.authorId)); - } - } - return error("Author not found"); - } -} - -type DeviceUserProfileData readonly & record {| - readonly int id; - string name; - int age; -|}; - -service class DeviceUserProfile { - private final DeviceUserProfileData data; - - isolated function init(DeviceUserProfileData data) { - self.data = data; - } - - isolated resource function get id() returns @graphql:ID int => self.data.id; - - isolated resource function get name() returns string => self.data.name; - - isolated resource function get age() returns int => self.data.age; -} - -isolated table key(id) ratingTable = table [ - {id: 1, title: "Good", stars: 4, description: "Good product", authorId: 1}, - {id: 2, title: "Bad", stars: 2, description: "Bad product", authorId: 2}, - {id: 3, title: "Excellent", stars: 5, description: "Excellent product", authorId: 3}, - {id: 4, title: "Poor", stars: 1, description: "Poor product", authorId: 4} -]; - -isolated table key(id) profileTable = table [ - {id: 1, name: "Alice", age: 25}, - {id: 2, name: "Bob", age: 30}, - {id: 3, name: "Charlie", age: 35}, - {id: 4, name: "David", age: 40} -]; - diff --git a/ballerina-tests/services.bal b/ballerina-tests/graphql-service-test-suite/services.bal similarity index 51% rename from ballerina-tests/services.bal rename to ballerina-tests/graphql-service-test-suite/services.bal index dac6c10ce..af73340ec 100644 --- a/ballerina-tests/services.bal +++ b/ballerina-tests/graphql-service-test-suite/services.bal @@ -15,7 +15,6 @@ // under the License. import ballerina/graphql as gql; -import ballerina/graphql; listener gql:Listener graphqlListener = new (9098); @@ -38,56 +37,3 @@ service /interfaces_implementing_interface on graphqlListener { return id <= animals.length() && id > 0 ? animals[id - 1] : (); } } - -@gql:ServiceConfig { - queryComplexityConfig: { - maxComplexity: 20, - defaultFieldComplexity: 2 - } -} -service /complexity on graphqlListener { - resource function get greeting() returns string { - return "Hello"; - } - - @gql:ResourceConfig { - complexity: 10 - } - resource function get device(int id) returns Device { - if id < 10 { - return new Phone(id, "Apple", "iPhone 15 Pro", 1199.00, "iOS"); - } - - if id < 20 { - return new Laptop(id, "Apple", "MacBook Pro", 2399.00, "M1", 32); - } - - return new Tablet(id, "Samsung", "Galaxy Tab S7", 649.99, true); - } - - @gql:ResourceConfig { - complexity: 5 - } - resource function get mobile(int id) returns Mobile { - if id < 10 { - return new Phone(id, "Apple", "iPhone 15 Pro", 1199.00, "iOS"); - } - - return new Tablet(id, "Samsung", "Galaxy Tab S7", 649.99, true); - } - - @graphql:ResourceConfig { - complexity: 15 - } - remote function addReview(RatingInput input) returns Rating { - lock { - int id = ratingTable.length(); - RatingData rating = { - id, - ...input - }; - ratingTable.put(rating); - return new (rating); - } - } -} diff --git a/ballerina-tests/tests/01_listener_test.bal b/ballerina-tests/graphql-service-test-suite/tests/01_listener_test.bal similarity index 56% rename from ballerina-tests/tests/01_listener_test.bal rename to ballerina-tests/graphql-service-test-suite/tests/01_listener_test.bal index 06fe2cdd7..472e451ec 100644 --- a/ballerina-tests/tests/01_listener_test.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/01_listener_test.bal @@ -15,24 +15,24 @@ // under the License. import ballerina/graphql; +import ballerina/graphql_test_common as common; import ballerina/http; import ballerina/test; -import ballerina/websocket; @test:Config { groups: ["listener", "client"] } function testAttachingGraphQLServiceToDynamicListener() returns error? { - check specialTypesTestListener.attach(greetingService, "greet"); - string url = "http://localhost:9095/greet"; + check wrappedListener.attach(greetingService, "greet"); + string url = "http://localhost:9090/greet"; string document = string `query { greeting }`; - json actualPayload = check getJsonPayloadFromService(url, document); + json actualPayload = check common:getJsonPayloadFromService(url, document); json expectedPayload = { data: { greeting: "Hello, World" } }; - check specialTypesTestListener.detach(greetingService); + check wrappedListener.detach(greetingService); test:assertEquals(actualPayload, expectedPayload); } @@ -40,16 +40,16 @@ function testAttachingGraphQLServiceToDynamicListener() returns error? { groups: ["listener", "client"] } function testAttachingGraphQLServiceWithAnnotationToDynamicListener() returns error? { - check specialTypesTestListener.attach(greetingService2, "greet"); - string url = "http://localhost:9095/greet"; + check wrappedListener.attach(greetingService2, "greeting"); + string url = "http://localhost:9090/greeting"; string document = string `query { greeting }`; - json actualPayload = check getJsonPayloadFromService(url, document); + json actualPayload = check common:getJsonPayloadFromService(url, document); json expectedPayload = { data: { greeting: "Hello, World" } }; - check specialTypesTestListener.detach(greetingService2); + check wrappedListener.detach(greetingService2); test:assertEquals(actualPayload, expectedPayload); } @@ -58,15 +58,15 @@ function testAttachingGraphQLServiceWithAnnotationToDynamicListener() returns er dataProvider: dataProviderListener } function testListener(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderListener() returns string[][] { - string url1 = "http://localhost:9190/service_with_http2"; - string url2 = "http://localhost:9191/service_with_http1"; + string url1 = "http://localhost:9095/service_with_http2"; + string url2 = "http://localhost:9090/service_with_http1"; string url3 = "http://localhost:9090/annotations"; return [ [url1, "attach_service_with_query_to_http2_based_listener"], @@ -77,25 +77,13 @@ function dataProviderListener() returns string[][] { ]; } -@test:Config { - groups: ["subscriptions", "listener"] -} -function testAttachServiceWithSubscriptionToHttp2BasedListener() returns error? { - graphql:Error? result = http2BasedListener.attach(subscriptionService); - test:assertTrue(result is graphql:Error); - graphql:Error err = result; - string expecctedMessage = string `Websocket listener initialization failed due to the incompatibility of ` + - string `provided HTTP(version 2.0) listener`; - test:assertEquals(err.message(), expecctedMessage); -} - @test:Config { groups: ["listener", "client"] } function testAttachServiceWithQueryToHttp1BasedListenerAndClient() returns error? { string document = string `query { person{ age } }`; - string url = "http://localhost:9191/service_with_http1"; - json actualPayload = check getJsonPayloadUsingHttpClient(url, document, httpVersion = http:HTTP_1_0); + string url = "http://localhost:9090/service_with_http1"; + json actualPayload = check common:getJsonPayloadUsingHttpClient(url, document, httpVersion = http:HTTP_1_0); json expectedPayload = { data: { person: { @@ -103,7 +91,7 @@ function testAttachServiceWithQueryToHttp1BasedListenerAndClient() returns error } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { @@ -111,8 +99,8 @@ function testAttachServiceWithQueryToHttp1BasedListenerAndClient() returns error } function testAttachServiceWithMutationToHttp1BasedListenerAndClient() returns error? { string document = string `mutation { setName(name: "Heisenberg") { name } }`; - string url = "http://localhost:9191/service_with_http1"; - json actualPayload = check getJsonPayloadUsingHttpClient(url, document, httpVersion = http:HTTP_1_0); + string url = "http://localhost:9090/service_with_http1"; + json actualPayload = check common:getJsonPayloadUsingHttpClient(url, document, httpVersion = http:HTTP_1_0); json expectedPayload = { data: { setName: { @@ -120,29 +108,7 @@ function testAttachServiceWithMutationToHttp1BasedListenerAndClient() returns er } } }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["listener", "subscriptions"] -} -function testAttachServiceWithSubscriptionToHttp1BasedListener() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9191/service_with_http1"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2"); - - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: i}}; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { @@ -158,7 +124,7 @@ function testServiceDeclarationUsingLocalServiceObject() returns error? { string url = "http://localhost:9091/local_service_object"; string document = string `query { greeting }`; - json actualPayload = check getJsonPayloadFromService(url, document); + json actualPayload = check common:getJsonPayloadFromService(url, document); json expectedPayload = { data: { greeting: "Hello world" @@ -177,7 +143,7 @@ function testServiceDeclarationUsingObjectField() returns error? { string url = "http://localhost:9091/object_field_service_object"; string document = string `query { greeting }`; - json actualPayload = check getJsonPayloadFromService(url, document); + json actualPayload = check common:getJsonPayloadFromService(url, document); json expectedPayload = { data: { greeting: "Hello world" diff --git a/ballerina-tests/graphql-service-test-suite/tests/02_request_validation.bal b/ballerina-tests/graphql-service-test-suite/tests/02_request_validation.bal new file mode 100644 index 000000000..cba21110f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/02_request_validation.bal @@ -0,0 +1,148 @@ +// Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/http; +import ballerina/test; +import ballerina/url; + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testMultipleOperationsWithoutOperationNameInRequest() returns error? { + string document = check common:getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); + string url = "http://localhost:9091/records"; + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = { + errors: [ + { + message: "Must provide operation name if query contains multiple operations.", + locations: [] + } + ] + }; + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testMultipleOperationsWithInvalidOperationInRequest() returns error? { + string document = check common:getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); + string url = "http://localhost:9091/records"; + json actualPayload = check common:getJsonPayloadFromService(url, document, operationName = "invalid"); + json expectedPayload = { + errors: [ + { + message: "Unknown operation named \"invalid\".", + locations: [] + } + ] + }; + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testInvalidGetRequestWithoutQuery() returns error? { + http:Client httpClient = check new ("http://localhost:9091", httpVersion = "1.1"); + http:Response response = check httpClient->get("/records"); + common:assertResponseForBadRequest(response); + test:assertEquals(response.getTextPayload(), "Query not found"); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testGetRequest() returns error? { + string document = "query getDetective{ detective { name }}"; + string encodedDocument = check url:encode(document, "UTF-8"); + json expectedPayload = { + data: { + detective: { + name: "Sherlock Holmes" + } + } + }; + http:Client httpClient = check new ("http://localhost:9091", httpVersion = "1.1"); + string path = "/records?query=" + encodedDocument; + json actualPayload = check httpClient->get(path); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testGetRequestWithEmptyQuery() returns error? { + http:Client httpClient = check new ("http://localhost:9091", httpVersion = "1.1"); + string path = "/records?query="; + http:Response response = check httpClient->get(path); + common:assertResponseForBadRequest(response); + test:assertEquals(response.getTextPayload(), "Query not found"); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testInvalidJsonPayload() returns error? { + http:Request request = new; + request.setJsonPayload({}); + string payload = check common:getTextPayloadFromBadRequest("http://localhost:9091/records", request); + test:assertEquals(payload, "Invalid request body"); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testEmptyStringAsQuery() returns error? { + http:Request request = new; + request.setJsonPayload({query: ""}); + string payload = check common:getTextPayloadFromBadRequest("http://localhost:9091/records", request); + test:assertEquals(payload, "Invalid request body"); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testInvalidContentType() returns error? { + http:Request request = new; + request.setPayload("invalid"); + string payload = check common:getTextPayloadFromBadRequest("http://localhost:9091/records", request); + test:assertEquals(payload, "Invalid 'Content-type' received"); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testContentTypeGraphql() returns error? { + http:Request request = new; + request.setHeader("Content-Type", "application/graphql"); + string payload = check common:getTextPayloadFromBadRequest("http://localhost:9091/records", request); + test:assertEquals(payload, "Content-Type 'application/graphql' is not yet supported"); +} + +@test:Config { + groups: ["request_validation", "listener"] +} +isolated function testInvalidRequestBody() returns error? { + http:Request request = new; + request.setTextPayload("Invalid"); + request.setHeader("Content-Type", "application/json"); + string payload = check common:getTextPayloadFromBadRequest("http://localhost:9091/records", request); + test:assertEquals(payload, "Invalid request body"); +} + diff --git a/ballerina-tests/tests/03_document_validation.bal b/ballerina-tests/graphql-service-test-suite/tests/03_document_validation.bal similarity index 86% rename from ballerina-tests/tests/03_document_validation.bal rename to ballerina-tests/graphql-service-test-suite/tests/03_document_validation.bal index e1cce7ef1..2c8a69382 100644 --- a/ballerina-tests/tests/03_document_validation.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/03_document_validation.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,7 +23,7 @@ import ballerina/test; isolated function testDocumentWithSyntaxError() returns error? { string graphqlUrl = "http://localhost:9091/records"; string document = "{ name (id: ) }"; - json actualPayload = check getJsonPayloadFromService(graphqlUrl, document); + json actualPayload = check common:getJsonPayloadFromService(graphqlUrl, document); string expectedMessage = string `Syntax Error: Unexpected ")".`; json expectedPayload = { errors: [ @@ -37,5 +38,5 @@ isolated function testDocumentWithSyntaxError() returns error? { } ] }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } diff --git a/ballerina-tests/tests/04_input_parameters.bal b/ballerina-tests/graphql-service-test-suite/tests/04_input_parameters.bal similarity index 76% rename from ballerina-tests/tests/04_input_parameters.bal rename to ballerina-tests/graphql-service-test-suite/tests/04_input_parameters.bal index 7821234cc..080f998a2 100644 --- a/ballerina-tests/tests/04_input_parameters.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/04_input_parameters.bal @@ -14,8 +14,9 @@ // specific language governing permissions and limitations // under the License. -import ballerina/test; +import ballerina/graphql_test_common as common; import ballerina/lang.value; +import ballerina/test; @test:Config { groups: ["inputs"], @@ -23,10 +24,10 @@ import ballerina/lang.value; } isolated function testInputParameters(string resourceFileName) returns error? { string url = "http://localhost:9091/inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderInputParameters() returns string[][] { @@ -50,14 +51,14 @@ function dataProviderInputParameters() returns string[][] { isolated function testFloatWithPositiveInfinity() returns error? { string document = "{ weightInPounds(weightInKg: 1.7E309) }"; string url = "http://localhost:9091/inputs"; - string actualPayload = check getTextPayloadFromService(url, document); + string actualPayload = check common:getTextPayloadFromService(url, document); json payloadWithFloatValues = check value:fromJsonFloatString(actualPayload); json expectedPayload = { data: { weightInPounds: float:Infinity } }; - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } @test:Config { @@ -66,12 +67,12 @@ isolated function testFloatWithPositiveInfinity() returns error? { isolated function testFloatNegativeInfinity() returns error? { string document = "{ weightInPounds(weightInKg: -1.7E309) }"; string url = "http://localhost:9091/inputs"; - string actualPayload = check getTextPayloadFromService(url, document); + string actualPayload = check common:getTextPayloadFromService(url, document); json payloadWithFloatValues = check value:fromJsonFloatString(actualPayload); json expectedPayload = { data: { weightInPounds: -float:Infinity } }; - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } diff --git a/ballerina-tests/tests/05_record_objects.bal b/ballerina-tests/graphql-service-test-suite/tests/05_record_objects.bal similarity index 78% rename from ballerina-tests/tests/05_record_objects.bal rename to ballerina-tests/graphql-service-test-suite/tests/05_record_objects.bal index 87afcc25c..964600ed2 100644 --- a/ballerina-tests/tests/05_record_objects.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/05_record_objects.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,10 +23,10 @@ import ballerina/test; } isolated function testRecordObjects(string resourceFileName) returns error? { string url = "http://localhost:9091/records"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderRecordObjects() returns string[][] { diff --git a/ballerina-tests/tests/06_runtime_errors.bal b/ballerina-tests/graphql-service-test-suite/tests/06_runtime_errors.bal similarity index 85% rename from ballerina-tests/tests/06_runtime_errors.bal rename to ballerina-tests/graphql-service-test-suite/tests/06_runtime_errors.bal index 4c7c2b86c..07985ec35 100644 --- a/ballerina-tests/tests/06_runtime_errors.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/06_runtime_errors.bal @@ -14,8 +14,9 @@ // specific language governing permissions and limitations // under the License. -import ballerina/test; +import ballerina/graphql_test_common as common; import ballerina/http; +import ballerina/test; import ballerina/url; @test:Config { @@ -24,8 +25,8 @@ import ballerina/url; isolated function testRuntimeError() returns error? { string graphqlUrl = "http://localhost:9091/records"; string document = "{ profile (id: 10) { name } }"; - http:Client httpClient = check new(graphqlUrl, httpVersion = "1.1"); - http:Response response = check httpClient->post("/", { query: document }); + http:Client httpClient = check new (graphqlUrl, httpVersion = "1.1"); + http:Response response = check httpClient->post("/", {query: document}); test:assertEquals(response.statusCode, 200); json actualPayload = check response.getJsonPayload(); @@ -45,7 +46,7 @@ isolated function testRuntimeError() returns error? { ], data: null }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } @test:Config { @@ -55,7 +56,7 @@ isolated function testRuntimeErrorWithGetRequest() returns error? { string graphqlUrl = "http://localhost:9091"; string document = "{ profile (id: 10) { name } }"; string encodedDocument = check url:encode(document, "UTF-8"); - http:Client httpClient = check new(graphqlUrl, httpVersion = "1.1"); + http:Client httpClient = check new (graphqlUrl, httpVersion = "1.1"); string path = "/records?query=" + encodedDocument; http:Response response = check httpClient->get(path); test:assertEquals(response.statusCode, 200); @@ -77,5 +78,5 @@ isolated function testRuntimeErrorWithGetRequest() returns error? { ], data: null }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } diff --git a/ballerina-tests/tests/07_service_objects.bal b/ballerina-tests/graphql-service-test-suite/tests/07_service_objects.bal similarity index 79% rename from ballerina-tests/tests/07_service_objects.bal rename to ballerina-tests/graphql-service-test-suite/tests/07_service_objects.bal index dda934a5f..f990b2248 100644 --- a/ballerina-tests/tests/07_service_objects.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/07_service_objects.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderServiceObjects } isolated function testServiceObject(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderServiceObjects() returns string[][] { diff --git a/ballerina-tests/tests/09_arrays.bal b/ballerina-tests/graphql-service-test-suite/tests/08_arrays.bal similarity index 71% rename from ballerina-tests/tests/09_arrays.bal rename to ballerina-tests/graphql-service-test-suite/tests/08_arrays.bal index 913da6d05..f92d0e7b9 100644 --- a/ballerina-tests/tests/09_arrays.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/08_arrays.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,14 +22,14 @@ import ballerina/test; dataProvider: dataProviderArrays } isolated function testArrays(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderArrays() returns string[][] { - string url1 = "http://localhost:9095/special_types"; + string url1 = "http://localhost:9090/special_types"; string url2 = "http://localhost:9092/service_objects"; return [ @@ -48,9 +49,9 @@ function dataProviderArrays() returns string[][] { } isolated function testServiceObjectArrayWithInvalidResponseOrder() returns error? { string graphqlUrl = "http://localhost:9092/service_objects"; - string document = check getGraphqlDocumentFromFile("service_object_array_with_invalid_response_order"); - json result = check getJsonPayloadFromService(graphqlUrl, document); - json expectedPayload = check getJsonContentFromFile("service_object_array_with_invalid_response_order"); + string document = check common:getGraphqlDocumentFromFile("service_object_array_with_invalid_response_order"); + json result = check common:getJsonPayloadFromService(graphqlUrl, document); + json expectedPayload = check common:getJsonContentFromFile("service_object_array_with_invalid_response_order"); test:assertEquals(result, expectedPayload); string actualPayloadString = result.toString(); string expectedPayloadString = expectedPayload.toString(); diff --git a/ballerina-tests/tests/10_introspection_queries.bal b/ballerina-tests/graphql-service-test-suite/tests/09_introspection_queries.bal similarity index 90% rename from ballerina-tests/tests/10_introspection_queries.bal rename to ballerina-tests/graphql-service-test-suite/tests/09_introspection_queries.bal index e8e192ddd..d8e1bf716 100644 --- a/ballerina-tests/tests/10_introspection_queries.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/09_introspection_queries.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderIntrospection } isolated function testIntrospection(string url, string resourceFileName, json variables = ()) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderIntrospection() returns map<[string, string, json]> { @@ -33,7 +34,6 @@ function dataProviderIntrospection() returns map<[string, string, json]> { string url3 = "http://localhost:9091/mutations"; string url4 = "http://localhost:9092/unions"; string url5 = "http://localhost:9091/input_objects"; - string url6 = "http://localhost:9091/inputs"; string url7 = "http://localhost:9091/documentation"; string url8 = "http://localhost:9090/deprecation"; string url9 = "http://localhost:9091/id_annotation_1"; diff --git a/ballerina-tests/tests/11_configurations_test.bal b/ballerina-tests/graphql-service-test-suite/tests/10_configurations_test.bal similarity index 84% rename from ballerina-tests/tests/11_configurations_test.bal rename to ballerina-tests/graphql-service-test-suite/tests/10_configurations_test.bal index 663310603..82f589fd9 100644 --- a/ballerina-tests/tests/11_configurations_test.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/10_configurations_test.bal @@ -25,7 +25,7 @@ isolated function testTimeoutResponse() returns error? { json payload = { query: document }; - http:Client httpClient = check new("http://localhost:9093/timeoutService", httpVersion = "1.1"); + http:Client httpClient = check new ("http://localhost:9093/timeoutService", httpVersion = "1.1"); http:Request request = new; request.setPayload(payload); http:Response response = check httpClient->post("/", request); @@ -42,11 +42,11 @@ isolated function testTimeoutResponse() returns error? { isolated function testCorsConfigurationWithWildCard() returns error? { string url = "http://localhost:9091"; map headers = { - ["origin"]:"http://www.wso2.com", - ["access-control-request-method"]:["POST"], - ["access-control-request-headers"]:["X-Content-Type-Options"] + ["origin"]: "http://www.wso2.com", + ["access-control-request-method"]: ["POST"], + ["access-control-request-headers"]: ["X-Content-Type-Options"] }; - http:Client httpClient = check new(url, httpVersion = "1.1"); + http:Client httpClient = check new (url, httpVersion = "1.1"); http:Response response = check httpClient->options("/corsConfigService1", headers); // send preflight request test:assertEquals(check response.getHeader("access-control-allow-origin"), "http://www.wso2.com"); test:assertTrue(response.hasHeader("access-control-allow-credentials")); @@ -61,11 +61,11 @@ isolated function testCorsConfigurationWithWildCard() returns error? { isolated function testCorsConfigurationsWithSpecificOrigins() returns error? { string url = "http://localhost:9091"; map headers = { - ["origin"]:"http://www.wso2.com", - ["access-control-request-method"]:["POST"], - ["access-control-request-headers"]:["X-PINGOTHER"] + ["origin"]: "http://www.wso2.com", + ["access-control-request-method"]: ["POST"], + ["access-control-request-headers"]: ["X-PINGOTHER"] }; - http:Client httpClient = check new(url, httpVersion = "1.1"); + http:Client httpClient = check new (url, httpVersion = "1.1"); http:Response response = check httpClient->options("/corsConfigService2", headers); // send preflight request test:assertEquals(check response.getHeader("access-control-allow-origin"), "http://www.wso2.com"); test:assertNotEquals(check response.getHeader("access-control-allow-origin"), "http://www.ws02.com"); diff --git a/ballerina-tests/tests/12_hierarchical_resource_paths.bal b/ballerina-tests/graphql-service-test-suite/tests/11_hierarchical_resource_paths.bal similarity index 83% rename from ballerina-tests/tests/12_hierarchical_resource_paths.bal rename to ballerina-tests/graphql-service-test-suite/tests/11_hierarchical_resource_paths.bal index a8d0fba7c..e7a0cc775 100644 --- a/ballerina-tests/tests/12_hierarchical_resource_paths.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/11_hierarchical_resource_paths.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderHierarchicalResourcePaths } isolated function testHierarchicalResourcePaths(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderHierarchicalResourcePaths() returns string[][] { diff --git a/ballerina-tests/tests/13_tables.bal b/ballerina-tests/graphql-service-test-suite/tests/12_tables.bal similarity index 77% rename from ballerina-tests/tests/13_tables.bal rename to ballerina-tests/graphql-service-test-suite/tests/12_tables.bal index f26dc884a..99d1e930c 100644 --- a/ballerina-tests/tests/13_tables.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/12_tables.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderTables } isolated function testTables(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderTables() returns string[][] { diff --git a/ballerina-tests/tests/14_fragments.bal b/ballerina-tests/graphql-service-test-suite/tests/13_fragments.bal similarity index 83% rename from ballerina-tests/tests/14_fragments.bal rename to ballerina-tests/graphql-service-test-suite/tests/13_fragments.bal index 0b973d789..074769f28 100644 --- a/ballerina-tests/tests/14_fragments.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/13_fragments.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderFragments } isolated function testFragments(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderFragments() returns string[][] { diff --git a/ballerina-tests/tests/15_enums.bal b/ballerina-tests/graphql-service-test-suite/tests/14_enums.bal similarity index 78% rename from ballerina-tests/tests/15_enums.bal rename to ballerina-tests/graphql-service-test-suite/tests/14_enums.bal index 4f5e4d459..34c53bb68 100644 --- a/ballerina-tests/tests/15_enums.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/14_enums.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,11 +22,11 @@ import ballerina/test; dataProvider: dataProviderEnums } isolated function testEnum(string resourceFileName, json variables = ()) returns error? { - string url = "http://localhost:9095/special_types"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string url = "http://localhost:9090/special_types"; + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderEnums() returns map<[string, json]> { diff --git a/ballerina-tests/tests/16_maps.bal b/ballerina-tests/graphql-service-test-suite/tests/15_maps.bal similarity index 75% rename from ballerina-tests/tests/16_maps.bal rename to ballerina-tests/graphql-service-test-suite/tests/15_maps.bal index 8a4d61128..be54f4fd9 100644 --- a/ballerina-tests/tests/16_maps.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/15_maps.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,18 +22,18 @@ import ballerina/test; dataProvider: dataProviderMaps } isolated function testMap(string url, string resourceFileName, json variables = ()) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderMaps() returns map<[string, string, json]> { - string url1 = "http://localhost:9095/special_types"; + string url1 = "http://localhost:9090/special_types"; string url2 = "http://localhost:9091/maps"; string url3 = "http://localhost:9090/reviews"; - map<[string, string, json ]> dataSet = { + map<[string, string, json]> dataSet = { "1": [url1, "map"], "2": [url1, "nested_map"], "3": [url1, "map_without_key_input"], diff --git a/ballerina-tests/tests/17_recursive_types.bal b/ballerina-tests/graphql-service-test-suite/tests/16_recursive_types.bal similarity index 77% rename from ballerina-tests/tests/17_recursive_types.bal rename to ballerina-tests/graphql-service-test-suite/tests/16_recursive_types.bal index 83a780dfe..e5422e308 100644 --- a/ballerina-tests/tests/17_recursive_types.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/16_recursive_types.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,10 +23,10 @@ import ballerina/test; } isolated function testRecursiveServiceTypes(string resourceFileName) returns error? { string url = "http://localhost:9092/snowtooth"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderRecursiveServiceTypes() returns string[][] { diff --git a/ballerina-tests/tests/19_distinct_service_unions.bal b/ballerina-tests/graphql-service-test-suite/tests/17_distinct_service_unions.bal similarity index 82% rename from ballerina-tests/tests/19_distinct_service_unions.bal rename to ballerina-tests/graphql-service-test-suite/tests/17_distinct_service_unions.bal index afa1620f0..6081d1474 100644 --- a/ballerina-tests/tests/19_distinct_service_unions.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/17_distinct_service_unions.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderDistinctServiceObjects } isolated function testUnionOfDistinctServiceObjects(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderDistinctServiceObjects() returns string[][] { diff --git a/ballerina-tests/tests/20_document_with_duplicate_fields.bal b/ballerina-tests/graphql-service-test-suite/tests/18_document_with_duplicate_fields.bal similarity index 90% rename from ballerina-tests/tests/20_document_with_duplicate_fields.bal rename to ballerina-tests/graphql-service-test-suite/tests/18_document_with_duplicate_fields.bal index 1d73c1d4b..1245c1bf3 100644 --- a/ballerina-tests/tests/20_document_with_duplicate_fields.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/18_document_with_duplicate_fields.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderDuplicateFields } isolated function testDuplicateFields(string url, string resourceFileName, string jsonFileName, json variables = (), string? operationName = ()) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationName); - json expectedPayload = check getJsonContentFromFile(jsonFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationName); + json expectedPayload = check common:getJsonContentFromFile(jsonFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderDuplicateFields() returns map<[string, string, string, json, string?]> { diff --git a/ballerina-tests/tests/21_aliases.bal b/ballerina-tests/graphql-service-test-suite/tests/19_aliases.bal similarity index 80% rename from ballerina-tests/tests/21_aliases.bal rename to ballerina-tests/graphql-service-test-suite/tests/19_aliases.bal index 070719524..194ea5011 100644 --- a/ballerina-tests/tests/21_aliases.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/19_aliases.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderAliases } isolated function testAlias(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderAliases() returns string[][] { diff --git a/ballerina-tests/tests/22_variables.bal b/ballerina-tests/graphql-service-test-suite/tests/20_variables.bal similarity index 82% rename from ballerina-tests/tests/22_variables.bal rename to ballerina-tests/graphql-service-test-suite/tests/20_variables.bal index 0b804365f..6689f9203 100644 --- a/ballerina-tests/tests/22_variables.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/20_variables.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/http; import ballerina/test; @@ -22,11 +23,11 @@ import ballerina/test; } isolated function testInvalidRequestWithVariables() returns error? { http:Request request = new; - string document = string`($userName:String){ greet (name: $userName) }`; + string document = string `($userName:String){ greet (name: $userName) }`; json variables = "Thisaru"; - request.setJsonPayload({ query: document, variables: variables }); + request.setJsonPayload({query: document, variables: variables}); string url = "http://localhost:9091/inputs"; - string actualPayload = check getTextPayloadFromBadRequest(url, request); + string actualPayload = check common:getTextPayloadFromBadRequest(url, request); test:assertEquals(actualPayload, "Invalid format in request parameter: variables"); } @@ -35,16 +36,16 @@ isolated function testInvalidRequestWithVariables() returns error? { dataProvider: dataProviderInputVariables } isolated function testInputVariables(string url, string resourceFileName, json variables, string? operationName = ()) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationName); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationName); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderInputVariables() returns map<[string, string, json, string?]> { string url1 = "http://localhost:9091/inputs"; string url2 = "http://localhost:9091/records"; - string url3 = "http://localhost:9095/special_types"; + string url3 = "http://localhost:9090/special_types"; string url4 = "http://localhost:9091/null_values"; string url5 = "http://localhost:9091/documentation"; json var1 = { diff --git a/ballerina-tests/tests/23_mutations.bal b/ballerina-tests/graphql-service-test-suite/tests/21_mutations.bal similarity index 78% rename from ballerina-tests/tests/23_mutations.bal rename to ballerina-tests/graphql-service-test-suite/tests/21_mutations.bal index 80535a46a..ac43a2e89 100644 --- a/ballerina-tests/tests/23_mutations.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/21_mutations.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderMutation } isolated function testMutationRequestOnNonMutatableSchema(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderMutation() returns string[][] { diff --git a/ballerina-tests/tests/24_block_strings.bal b/ballerina-tests/graphql-service-test-suite/tests/22_block_strings.bal similarity index 81% rename from ballerina-tests/tests/24_block_strings.bal rename to ballerina-tests/graphql-service-test-suite/tests/22_block_strings.bal index aaf075c29..5561818d3 100644 --- a/ballerina-tests/tests/24_block_strings.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/22_block_strings.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,9 +23,9 @@ import ballerina/test; } isolated function testBlockStrings(string resourceFileName) returns error? { string url = "http://localhost:9091/inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); test:assertEquals(actualPayload, expectedPayload); } diff --git a/ballerina-tests/tests/25_input_objects.bal b/ballerina-tests/graphql-service-test-suite/tests/23_input_objects.bal similarity index 82% rename from ballerina-tests/tests/25_input_objects.bal rename to ballerina-tests/graphql-service-test-suite/tests/23_input_objects.bal index 2ca173872..eefffee71 100644 --- a/ballerina-tests/tests/25_input_objects.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/23_input_objects.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,10 +23,10 @@ import ballerina/test; } isolated function testInputObject(string resourceFileName, json variables = ()) returns error? { string url = "http://localhost:9091/input_objects"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderInputObject() returns map<[string, json]> { @@ -79,7 +80,7 @@ function dataProviderInputObject() returns map<[string, json]> { json var7 = { bName: "Harry", - bAuthor: [{name:"arthur"}, {name:"J.K Rowling"}], + bAuthor: [{name: "arthur"}, {name: "J.K Rowling"}], dir: "Chris Columbus" }; @@ -88,9 +89,9 @@ function dataProviderInputObject() returns map<[string, json]> { "2": ["input_object_with_missing_arguments"], "3": ["input_object_with_invalid_arguments1"], "4": ["input_object_with_invalid_arguments2"], - "5": ["input_object_with_variables", {profile:{name:"Arthur", age:5}}], + "5": ["input_object_with_variables", {profile: {name: "Arthur", age: 5}}], "6": ["input_object_with_nested_input_object_variables", var1], - "7": ["input_object_include_fields_with_variables", {bName:"Harry Potter", authorAge:50}], + "7": ["input_object_include_fields_with_variables", {bName: "Harry Potter", authorAge: 50}], "8": ["input_object_with_duplicate_fields", var2], "9": ["input_object_with_undefined_fields", var2], "10": ["input_object_include_fields_with_undefined_variables", {authorAge: 50}], @@ -99,14 +100,14 @@ function dataProviderInputObject() returns map<[string, json]> { "13": ["input_object_with_default_value"], "14": ["input_object_without_optional_fields"], "15": ["input_object_with_missing_variables_arguments", var4], - "16": ["input_object_with_enum_type_argument", {day:{day: SUNDAY}}], + "16": ["input_object_with_enum_type_argument", {day: {day: SUNDAY}}], "17": ["input_object_with_fragment_and_variables", var5], "18": ["input_object_with_inline_fragment_with_variables", var6], - "19": ["input_object_with_float_type_variables", {weight: { weightInKg: 70.5 }}], - "20": ["input_object_with_invalid_type_variables1", {weight: { weight: 70.5 }}], - "21": ["input_object_with_invalid_type_variables2", {bAuthor: {name:{}, age:{}}}], + "19": ["input_object_with_float_type_variables", {weight: {weightInKg: 70.5}}], + "20": ["input_object_with_invalid_type_variables1", {weight: {weight: 70.5}}], + "21": ["input_object_with_invalid_type_variables2", {bAuthor: {name: {}, age: {}}}], "22": ["input_object_with_unexpected_variable_values", var7], - "23": ["input_object_variables_with_invalid_type_name", {profile:{name: "Arthur", age: 5}}], + "23": ["input_object_variables_with_invalid_type_name", {profile: {name: "Arthur", age: 5}}], "24": ["input_object_with_missing_nullable_variable_value"], "25": ["default_values_in_input_object_fields"] }; diff --git a/ballerina-tests/tests/26_nullable_values.bal b/ballerina-tests/graphql-service-test-suite/tests/24_nullable_values.bal similarity index 86% rename from ballerina-tests/tests/26_nullable_values.bal rename to ballerina-tests/graphql-service-test-suite/tests/24_nullable_values.bal index 4b661104a..914a99eef 100644 --- a/ballerina-tests/tests/26_nullable_values.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/24_nullable_values.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderNullableValues } isolated function testNullableValues(string url, string resourceFileName, json variables = ()) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderNullableValues() returns map<[string, string, json]> { diff --git a/ballerina-tests/tests/28_directives.bal b/ballerina-tests/graphql-service-test-suite/tests/25_directives.bal similarity index 75% rename from ballerina-tests/tests/28_directives.bal rename to ballerina-tests/graphql-service-test-suite/tests/25_directives.bal index 6126cc15d..7f03751ef 100644 --- a/ballerina-tests/tests/28_directives.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/25_directives.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderDirectives } isolated function testDirectives(string url, string resourceFileName, json variables) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderDirectives() returns map<[string, string, json]> { @@ -34,8 +35,8 @@ function dataProviderDirectives() returns map<[string, string, json]> { map<[string, string, json]> dataSet = { "1": [url1, "directives"], - "2": [url2, "directives_with_variables_and_fragments", { optional: false }], - "3": [url2, "directives_with_duplicate_fields", { optional: false }], + "2": [url2, "directives_with_variables_and_fragments", {optional: false}], + "3": [url2, "directives_with_duplicate_fields", {optional: false}], "4": [url3, "directives_with_service_returning_objects_array"], "5": [url2, "multiple_directive_usage_in_fields"], "6": [url2, "directives_skip_all_selections"] diff --git a/ballerina-tests/tests/29_list_type_inputs.bal b/ballerina-tests/graphql-service-test-suite/tests/26_list_type_inputs.bal similarity index 88% rename from ballerina-tests/tests/29_list_type_inputs.bal rename to ballerina-tests/graphql-service-test-suite/tests/26_list_type_inputs.bal index af880a3a9..ce92904b2 100644 --- a/ballerina-tests/tests/29_list_type_inputs.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/26_list_type_inputs.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,10 +23,10 @@ import ballerina/test; } isolated function testListTypeInput(string resourceFileName, json variables = ()) returns error? { string url = "http://localhost:9091/list_inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderListTypeInput() returns map<[string, json]> { @@ -47,7 +48,7 @@ function dataProviderListTypeInput() returns map<[string, json]> { name: "Breaking Bad", episodes: [ { - title:"ep1" + title: "ep1" } ] } @@ -60,13 +61,13 @@ function dataProviderListTypeInput() returns map<[string, json]> { name: "Breaking Bad", episodes: [ { - title:"ep1" + title: "ep1" } ] }, { name: "Breaking Bad", - episodes:true + episodes: true } ] }; @@ -77,11 +78,11 @@ function dataProviderListTypeInput() returns map<[string, json]> { name: "GOT", episodes: [ { - title:"ep1", + title: "ep1", newCharacters: ["Sherlock", "Jessie"] }, { - title:"ep2", + title: "ep2", newCharacters: ["Michael", "Jessie"] } ] @@ -95,11 +96,11 @@ function dataProviderListTypeInput() returns map<[string, json]> { name: "GOT", episodes: [ { - title:"ep1", + title: "ep1", newCharacters: ["Sherlock", "Jessie"] }, { - title:"ep2", + title: "ep2", newCharacters: [true, 1] } ] @@ -108,11 +109,11 @@ function dataProviderListTypeInput() returns map<[string, json]> { }; json var6 = { - tvSeries:{ + tvSeries: { name: "Braking Bad", episodes: [ { - title:"Cancer Man", + title: "Cancer Man", newCharacters: ["Sherlock", "Jessie"] } ] @@ -124,8 +125,8 @@ function dataProviderListTypeInput() returns map<[string, json]> { name: "Breaking Bad", episodes: [ { - title:"Cancer Man", - newCharacters:[] + title: "Cancer Man", + newCharacters: [] } ] } @@ -136,7 +137,7 @@ function dataProviderListTypeInput() returns map<[string, json]> { name: "Breaking Bad", episodes: [ { - title:"Cancer Man", + title: "Cancer Man", newCharacters: [true, 44] } ] diff --git a/ballerina-tests/tests/31_intersection_types.bal b/ballerina-tests/graphql-service-test-suite/tests/27_intersection_types.bal similarity index 86% rename from ballerina-tests/tests/31_intersection_types.bal rename to ballerina-tests/graphql-service-test-suite/tests/27_intersection_types.bal index 169ee2f70..82825ecb3 100644 --- a/ballerina-tests/tests/31_intersection_types.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/27_intersection_types.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,11 +22,11 @@ import ballerina/test; dataProvider: dataProviderIntersectionType } isolated function testIntersectionType(string jsonFileName, string operationName, json variables) returns error? { - string document = check getGraphqlDocumentFromFile("intersection_types"); + string document = check common:getGraphqlDocumentFromFile("intersection_types"); string url = "http://localhost:9091/intersection_types"; - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationName = operationName); - json expectedPayload = check getJsonContentFromFile(jsonFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables, operationName = operationName); + json expectedPayload = check common:getJsonContentFromFile(jsonFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderIntersectionType() returns map<[string, string, json]> { diff --git a/ballerina-tests/tests/32_decimal_type.bal b/ballerina-tests/graphql-service-test-suite/tests/28_decimal_type.bal similarity index 73% rename from ballerina-tests/tests/32_decimal_type.bal rename to ballerina-tests/graphql-service-test-suite/tests/28_decimal_type.bal index de813537e..95763e2b5 100644 --- a/ballerina-tests/tests/32_decimal_type.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/28_decimal_type.bal @@ -14,8 +14,9 @@ // specific language governing permissions and limitations // under the License. -import ballerina/test; +import ballerina/graphql_test_common as common; import ballerina/lang.value; +import ballerina/test; @test:Config { groups: ["inputs", "decimal"], @@ -23,14 +24,13 @@ import ballerina/lang.value; } isolated function testDecimalType1(string resourceFileName, json variables) returns error? { string url = "http://localhost:9091/inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables = variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables = variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); map payloadWithFloatValues = check actualPayload.cloneWithType(); - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } - function dataProviderDecimalType1() returns map<[string, json]> { map<[string, json]> dataSet = { "1": ["decimal_type_input", ()], @@ -49,14 +49,13 @@ function dataProviderDecimalType1() returns map<[string, json]> { } isolated function testDecimalType2(string resourceFileName, map? variables) returns error? { string url = "http://localhost:9091/inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables = variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables = variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); map payloadWithFloatValues = check actualPayload.cloneWithType(); - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } - function dataProviderDecimalType2() returns map<[string, map?]> { map<[string, map?]> dataSet = { "1": ["decimal_type_list_input", {prices: [[1.3323232, 4.856343], [5.63535, 6], [5, 7, 8]]}], @@ -77,14 +76,14 @@ isolated function testDecimalTypeVariableInput() returns error? { val: 2.3332414141451451411231341451 }; string url = "http://localhost:9091/inputs"; - json actualPayload = check getJsonPayloadFromService(url, document, variables); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); map payloadWithFloatValues = check actualPayload.cloneWithType(); json expectedPayload = { data: { convertDecimalToFloat: 2.3332414141451451411231341451 } }; - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } @test:Config { @@ -93,14 +92,14 @@ isolated function testDecimalTypeVariableInput() returns error? { isolated function testDecimalTypeDefaultValue() returns error? { string document = "($val:Decimal! = 2.3332414141451451411231341451){ convertDecimalToFloat(value:$val) }"; string url = "http://localhost:9091/inputs"; - json actualPayload = check getJsonPayloadFromService(url, document); + json actualPayload = check common:getJsonPayloadFromService(url, document); map payloadWithFloatValues = check actualPayload.cloneWithType(); json expectedPayload = { data: { convertDecimalToFloat: 2.3332414141451451411231341451 } }; - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } @test:Config { @@ -110,16 +109,16 @@ isolated function testDecimalWithMarginalValue() returns error? { string document = "($val:Decimal!){ convertDecimalToFloat(value:$val) }"; string url = "http://localhost:9091/inputs"; json variables = { - val: 1.797693134862314E+308 + val: 1.797693134862314E+308 }; - json actualPayload = check getJsonPayloadFromService(url, document, variables); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); map payloadWithFloatValues = check actualPayload.cloneWithType(); json expectedPayload = { data: { convertDecimalToFloat: 1.797693134862314E308 } }; - assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); + common:assertJsonValuesWithOrder(payloadWithFloatValues, expectedPayload); } @test:Config { @@ -128,10 +127,10 @@ isolated function testDecimalWithMarginalValue() returns error? { } isolated function testDecimalType3(string resourceFileName) returns error? { string url = "http://localhost:9091/inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderDecimalType3() returns string[][] { diff --git a/ballerina-tests/tests/33_nullable_inputs.bal b/ballerina-tests/graphql-service-test-suite/tests/29_nullable_inputs.bal similarity index 78% rename from ballerina-tests/tests/33_nullable_inputs.bal rename to ballerina-tests/graphql-service-test-suite/tests/29_nullable_inputs.bal index 8dfa12db0..300b5536a 100644 --- a/ballerina-tests/tests/33_nullable_inputs.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/29_nullable_inputs.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,10 +23,10 @@ import ballerina/test; } isolated function testNullInputForNullableRecord(string resourceFileName) returns error? { string url = "http://localhost:9091/nullable_inputs"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderNullableInputs() returns string[][] { diff --git a/ballerina-tests/tests/34_graphiql_client.bal b/ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal similarity index 62% rename from ballerina-tests/tests/34_graphiql_client.bal rename to ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal index 11f1273d9..45466aacf 100644 --- a/ballerina-tests/tests/34_graphiql_client.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal @@ -15,6 +15,7 @@ // under the License. import ballerina/graphql; +import ballerina/graphql_test_common as common; import ballerina/http; import ballerina/test; @@ -34,7 +35,7 @@ function testGraphiqlWithSamePathAsGraphQLService() returns error? { dataProvider: dataProviderGraphiqlClient } function testGraphiqlClientTest(string url, string path, string contentType) returns error? { - http:Client httpClient = check new(url, httpVersion = "1.1"); + http:Client httpClient = check new (url, httpVersion = "1.1"); http:Response|error response = httpClient->get(path); test:assertFalse(response is error); http:Response graphiqlResponse = check response; @@ -46,33 +47,10 @@ function dataProviderGraphiqlClient() returns string[][] { string url2 = "http://localhost:9092"; return [ - [url1, "/ballerina graphql", CONTENT_TYPE_APPLICATION_JSON], - [url1, "/graphiql", CONTENT_TYPE_TEXT_HTML], - [url1, "/ballerina/graphiql", CONTENT_TYPE_TEXT_HTML], - [url2, "/graphiql", CONTENT_TYPE_TEXT_HTML], - [url1, "/graphiql/interface", CONTENT_TYPE_TEXT_HTML] + [url1, "/ballerina graphql", common:CONTENT_TYPE_APPLICATION_JSON], + [url1, "/graphiql", common:CONTENT_TYPE_TEXT_HTML], + [url1, "/ballerina/graphiql", common:CONTENT_TYPE_TEXT_HTML], + [url2, "/graphiql", common:CONTENT_TYPE_TEXT_HTML], + [url1, "/graphiql/interface", common:CONTENT_TYPE_TEXT_HTML] ]; } - -@test:Config { - groups: ["listener", "graphiql"] -} -function testGraphiqlClientWithSSL() returns error? { - http:Client clientEP = check new ("https://localhost:9096", - auth = { - username: "alice", - password: "xxx" - }, - secureSocket = { - cert: { - path: TRUSTSTORE_PATH, - password: "ballerina" - } - }, - httpVersion = "1.1" - ); - http:Response|error response = clientEP->get("/graphiql"); - test:assertFalse(response is error); - http:Response graphiqlResponse = check response; - test:assertEquals(graphiqlResponse.getContentType(), CONTENT_TYPE_TEXT_HTML); -} diff --git a/ballerina-tests/tests/37_interfaces.bal b/ballerina-tests/graphql-service-test-suite/tests/31_interfaces.bal similarity index 82% rename from ballerina-tests/tests/37_interfaces.bal rename to ballerina-tests/graphql-service-test-suite/tests/31_interfaces.bal index fd0139961..24645e127 100644 --- a/ballerina-tests/tests/37_interfaces.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/31_interfaces.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -21,10 +22,10 @@ import ballerina/test; dataProvider: dataProviderInterface } isolated function testInterfaces(string url, string resourceFileName) returns error? { - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderInterface() returns string[][] { diff --git a/ballerina-tests/tests/43_id_input_type_validation.bal b/ballerina-tests/graphql-service-test-suite/tests/32_id_input_type_validation.bal similarity index 83% rename from ballerina-tests/tests/43_id_input_type_validation.bal rename to ballerina-tests/graphql-service-test-suite/tests/32_id_input_type_validation.bal index 11b0da52c..8113fccb3 100644 --- a/ballerina-tests/tests/43_id_input_type_validation.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/32_id_input_type_validation.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -22,16 +23,16 @@ import ballerina/test; } isolated function testIdTypeAnnotation(string resourceFileName, json variables = ()) returns error? { string url = "http://localhost:9091/id_annotation_2"; - string document = check getGraphqlDocumentFromFile(resourceFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + string document = check common:getGraphqlDocumentFromFile(resourceFileName); + json actualPayload = check common:getJsonPayloadFromService(url, document, variables); + json expectedPayload = check common:getJsonContentFromFile(resourceFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderIdAnnotation() returns map<[string, json]> { json values = { - "ids" : ["2.9", "3.3", "4.5"] - }; + "ids": ["2.9", "3.3", "4.5"] + }; map<[string, json]> dataSet = { "1": ["id_input_type_validation_string"], "2": ["id_input_type_validation_int"], diff --git a/ballerina-tests/tests/test_listeners.bal b/ballerina-tests/graphql-service-test-suite/tests/listeners.bal similarity index 60% rename from ballerina-tests/tests/test_listeners.bal rename to ballerina-tests/graphql-service-test-suite/tests/listeners.bal index e09d31039..c925fb35c 100644 --- a/ballerina-tests/tests/test_listeners.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/listeners.bal @@ -24,21 +24,6 @@ listener graphql:Listener basicListener = new (9091); listener graphql:Listener serviceTypeListener = new (9092); listener graphql:Listener timeoutListener = new (9093, {timeout: 1.0}); listener graphql:Listener hierarchicalPathListener = new (9094); -listener graphql:Listener specialTypesTestListener = new (9095); -listener graphql:Listener secureListener = new (9096, secureSocket = { - key: { - path: KEYSTORE_PATH, - password: "ballerina" - } -}); -listener graphql:Listener authTestListener = new (9097); -listener graphql:Listener subscriptionListener = new (9099); -// The mock authorization server, based with https://hub.docker.com/repository/docker/ldclakmal/ballerina-sts -listener http:Listener sts = new (9445, {secureSocket: {key: {path: KEYSTORE_PATH, password: "ballerina"}}}); - -listener http:Listener http2Listener = new http:Listener(9190); +listener http:Listener http2Listener = new http:Listener(9095); listener graphql:Listener http2BasedListener = new (http2Listener); - -listener http:Listener http1Listener = new http:Listener(9191, httpVersion = http:HTTP_1_0); -listener graphql:Listener http1BasedListener = new (http1Listener); diff --git a/ballerina-tests/tests/object_types.bal b/ballerina-tests/graphql-service-test-suite/tests/object_types.bal similarity index 51% rename from ballerina-tests/tests/object_types.bal rename to ballerina-tests/graphql-service-test-suite/tests/object_types.bal index f32f03dfd..8edf2cc00 100644 --- a/ballerina-tests/tests/object_types.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/object_types.bal @@ -15,8 +15,6 @@ // under the License. import ballerina/graphql; -import ballerina/graphql.dataloader; -import ballerina/lang.runtime; public type PeopleService StudentService|TeacherService; @@ -237,23 +235,6 @@ public distinct isolated service class School { } } -public isolated distinct service class AnimalClass { - isolated resource function get call(graphql:Context context, string sound, int count) returns string { - var scope = context.get("scope"); - if scope is string && scope == "admin" { - string call = ""; - int i = 0; - while i < count { - call += string `${sound} `; - i += 1; - } - return call; - } else { - return sound; - } - } -} - public isolated service class Vehicle { private final string id; private final string name; @@ -283,21 +264,6 @@ public isolated service class Vehicle { } } -class EvenNumberGenerator { - private int i = 0; - - public isolated function next() returns record {|int value;|}|error? { - self.i += 2; - if self.i == 4 { - return error("Runtime exception"); - } - if self.i > 6 { - return; - } - return {value: self.i}; - } -} - public service class Product { private final string id; @@ -328,145 +294,6 @@ public service class AccountDetails { } } -class RefreshData { - public isolated function next() returns record {|string value;|}? { - // emit data every one second - runtime:sleep(1); - return {value: "data"}; - } -} - -public distinct isolated service class Customer { - private final int id; - private final string name; - - public isolated function init(int id, string name) { - self.id = id; - self.name = name; - } - - @graphql:ResourceConfig { - interceptors: [new Counter(), new Counter(), new Counter()] - } - isolated resource function get id() returns int { - return self.id; - } - - @graphql:ResourceConfig { - interceptors: new NullReturn1() - } - isolated resource function get name() returns string? { - lock { - return self.name; - } - } - - isolated resource function get address() returns CustomerAddress { - return new (225, "Bakers street", "London"); - } -} - -public distinct isolated service class CustomerAddress { - private final int number; - private final string street; - private final string city; - - public isolated function init(int number, string street, string city) { - self.number = number; - self.street = street; - self.city = city; - } - - @graphql:ResourceConfig { - interceptors: [new Counter(), new Counter()] - } - isolated resource function get number() returns int { - return self.number; - } - - @graphql:ResourceConfig { - interceptors: new Street() - } - isolated resource function get street() returns string { - return self.street; - } - - @graphql:ResourceConfig { - interceptors: new City() - } - isolated resource function get city() returns string { - return self.city; - } -} - -public isolated distinct service class AuthorData { - private final readonly & AuthorRow author; - - isolated function init(AuthorRow author) { - self.author = author.cloneReadOnly(); - } - - isolated resource function get name() returns string { - return self.author.name; - } - - isolated function preBooks(graphql:Context ctx) { - dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); - bookLoader.add(self.author.id); - } - - isolated resource function get books(graphql:Context ctx) returns BookData[]|error { - dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); - BookRow[] bookrows = check bookLoader.get(self.author.id); - return from BookRow bookRow in bookrows - select new BookData(bookRow); - } -} - -public isolated distinct service class AuthorDetail { - private final readonly & AuthorRow author; - - isolated function init(AuthorRow author) { - self.author = author.cloneReadOnly(); - } - - isolated resource function get name() returns string { - return self.author.name; - } - - isolated function prefetchBooks(graphql:Context ctx) { - dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); - bookLoader.add(self.author.id); - } - - @graphql:ResourceConfig { - interceptors: new BookInterceptor(), - prefetchMethodName: "prefetchBooks" - } - isolated resource function get books(graphql:Context ctx) returns BookData[]|error { - dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER); - BookRow[] bookrows = check bookLoader.get(self.author.id); - return from BookRow bookRow in bookrows - select new BookData(bookRow); - } -} - -public isolated distinct service class BookData { - private final readonly & BookRow book; - - isolated function init(BookRow book) { - self.book = book.cloneReadOnly(); - } - - isolated resource function get id() returns int { - return self.book.id; - } - - isolated resource function get title() returns string { - return self.book.title; - } -} - distinct service class NestedField { resource function get multipleParams( int a = 1, @@ -476,117 +303,10 @@ distinct service class NestedField { boolean e = true, int? f = DEFAULT_INT_VALUE, Sex g = MALE, - InputObject h = {name: "name2", bmiHistory: [30.0 , 29.0, 20.0d]}, + InputObject h = {name: "name2", bmiHistory: [30.0, 29.0, 20.0d]}, InputObject[] i = [ - {name: "name3", bmiHistory: [30.0 , 29.0]}, + {name: "name3", bmiHistory: [30.0, 29.0]}, {name: "name4", bmiHistory: [2.9e1, 31.0]} ], @graphql:ID string[] j = ["id1"]) returns string? => (); } - -public type HumanService FriendService|EnemyService; - -public isolated distinct service class FriendService { - private final string name; - private final int age; - private final boolean isMarried; - - public isolated function init(string name, int age, boolean isMarried) { - self.name = name; - self.age = age; - self.isMarried = isMarried; - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 180 - } - } - isolated resource function get name() returns string { - return self.name; - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 180 - } - } - isolated resource function get age() returns int { - return self.age; - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 180 - } - } - isolated resource function get isMarried() returns boolean { - return self.isMarried; - } -} - -public isolated distinct service class AssociateService { - private final string name; - private final string status; - - public isolated function init(string name, string status) { - self.name = name; - self.status = status; - } - - isolated resource function get name() returns string { - return self.name; - } - - isolated resource function get status() returns string { - return self.status; - } -} - -public isolated distinct service class EnemyService { - private final string name; - private final int age; - private final boolean isMarried; - - public isolated function init(string name, int age, boolean isMarried) { - self.name = name; - self.age = age; - self.isMarried = isMarried; - } - - isolated resource function get name() returns string { - return self.name; - } - - isolated resource function get age() returns int { - return self.age; - } - - isolated resource function get isMarried() returns boolean { - return self.isMarried; - } -} - -public isolated distinct service class AuthorData2 { - private final readonly & AuthorRow author; - - isolated function init(AuthorRow author) { - self.author = author.cloneReadOnly(); - } - - isolated resource function get name() returns string { - return self.author.name; - } - - isolated function preBooks(graphql:Context ctx) { - dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER_2); - bookLoader.add(self.author.id); - } - - isolated resource function get books(graphql:Context ctx) returns BookData[]|error { - dataloader:DataLoader bookLoader = ctx.getDataLoader(BOOK_LOADER_2); - BookRow[] bookrows = check bookLoader.get(self.author.id); - return from BookRow bookRow in bookrows - select new BookData(bookRow); - } -} diff --git a/ballerina-tests/tests/records.bal b/ballerina-tests/graphql-service-test-suite/tests/records.bal similarity index 79% rename from ballerina-tests/tests/records.bal rename to ballerina-tests/graphql-service-test-suite/tests/records.bal index 7090ada47..06c0c8573 100644 --- a/ballerina-tests/tests/records.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/records.bal @@ -14,8 +14,6 @@ // specific language governing permissions and limitations // under the License. -import ballerina/constraint; - type Information Address|Person; public type Account record { @@ -200,13 +198,6 @@ public type Episode record { string[] newCharacters?; }; -public type FileInfo record { - string fileName; - string mimeType; - string encoding; - string content; -}; - public type Item record { string name; decimal price; @@ -256,9 +247,9 @@ public type CovidEntry record {| |}; public type Review record {| - Product product; - int score; - string description; + Product product; + int score; + string description; |}; public type AccountRecords record {| @@ -283,42 +274,6 @@ public type Task record {| type TaskTable table key(sprint); -public type MovieDetails record {| - @constraint:String { - minLength: 1, - maxLength: 10 - } - string name; - - @constraint:Int { - minValue: 18 - } - int downloads; - - @constraint:Float { - minValue: 1.5 - } - float imdb; - - @constraint:Array { - length: 1 - } - Reviews?[] reviews; -|}; - -public type Reviews readonly & record {| - @constraint:Array { - maxLength: 2 - } - string[] comments; - - @constraint:Int { - minValueExclusive: 0, - maxValueExclusive: 6 - } - int stars; -|}; - public type DeprecatedProfile record {| # # Deprecated # Name field is deprecated @@ -352,17 +307,6 @@ public type DeprecatedAddress record {| string city; |}; -type BookRow record {| - readonly int id; - string title; - int author; -|}; - -type AuthorRow record {| - readonly int id; - string name; -|}; - type InputObject record {| string name = "name"; decimal[]? bmiHistory = [1.0, 3]; @@ -377,39 +321,3 @@ type InputObject2 record {| type InputObject3 record {| int age = 30; |}; - -type Friend record {| - readonly string name; - int age; - boolean isMarried; -|}; - -type Enemy record {| - readonly string name; - int age; - boolean isMarried; -|}; - -type EnemyInput record {| - readonly string name = "Enemy6"; - int age = 12; -|}; - -type Associate record {| - readonly string name; - string status; -|}; - -public type Relationship FriendService|AssociateService; - -type User record {| - int id?; - string name?; - int age?; -|}; - -type ProfileInfo record {| - string name; - int age; - string contact; -|}; diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias.graphql new file mode 100644 index 000000000..24ffe151a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias.graphql @@ -0,0 +1,10 @@ +query getPerson { + sherlock: profile { + name { + first + } + address { + city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_error_path.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_error_path.graphql new file mode 100644 index 000000000..8a598a0fc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_error_path.graphql @@ -0,0 +1,7 @@ +query { + user: profile { + name_fields: name { + username: surname + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_hierarchical_resources.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_hierarchical_resources.graphql new file mode 100644 index 000000000..1dda7ede2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_hierarchical_resources.graphql @@ -0,0 +1,7 @@ +query getData { + sherlock: profile { + address { + hometown: city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_service_objects_union.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_service_objects_union.graphql new file mode 100644 index 000000000..d866c20b1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_on_service_objects_union.graphql @@ -0,0 +1,13 @@ +{ + jesse: profile(id: 5) { + ... on StudentService { + characterName: name + } + } + + walt: profile(id: 1000) { + ... on TeacherService { + ssn: id + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_with_invalid_field_name.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_with_invalid_field_name.graphql new file mode 100644 index 000000000..6d9a8d9a8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/alias_with_invalid_field_name.graphql @@ -0,0 +1,8 @@ +query getPerson { + sherlock: profile(id: 0) { + name: firstName + address { + city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/arrays_with_errors_in_record_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/arrays_with_errors_in_record_field.graphql new file mode 100644 index 000000000..eb6029865 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/arrays_with_errors_in_record_field.graphql @@ -0,0 +1,8 @@ +query { + project { + name + tasks { + subTasks + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql new file mode 100644 index 000000000..b9ef7e3f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql @@ -0,0 +1,5 @@ +mutation { + setName(name: "Heisenberg") { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql new file mode 100644 index 000000000..20ebca913 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql @@ -0,0 +1,5 @@ +query { + person { + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql new file mode 100644 index 000000000..20ebca913 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql @@ -0,0 +1,5 @@ +query { + person { + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql new file mode 100644 index 000000000..b9ef7e3f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql @@ -0,0 +1,5 @@ +mutation { + setName(name: "Heisenberg") { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/ballerina_record_as_graphql_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/ballerina_record_as_graphql_object.graphql new file mode 100644 index 000000000..a05cb2524 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/ballerina_record_as_graphql_object.graphql @@ -0,0 +1,8 @@ +query getPerson { + detective { + name + address { + street + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings.graphql new file mode 100644 index 000000000..924de7e54 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings.graphql @@ -0,0 +1,11 @@ +{ + sendEmail( + message: """ + Hello, + World!, + + Yours, + GraphQL + """ + ) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_double_quotes.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_double_quotes.graphql new file mode 100644 index 000000000..265549dd8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_double_quotes.graphql @@ -0,0 +1,11 @@ +{ + sendEmail( + message: """ + Hello, + ""World""!, + + Yours, + GraphQL + """ + ) +} diff --git a/ballerina-tests/tests/resources/documents/block_strings_with_escaped_character.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_escaped_character.graphql similarity index 50% rename from ballerina-tests/tests/resources/documents/block_strings_with_escaped_character.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_escaped_character.graphql index 40414730b..ec165322d 100644 --- a/ballerina-tests/tests/resources/documents/block_strings_with_escaped_character.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_escaped_character.graphql @@ -1,8 +1,11 @@ { - sendEmail(message: """ + sendEmail( + message: """ Hello, World!, \""" Yours, - GraphQL""") + GraphQL + """ + ) } diff --git a/ballerina-tests/tests/resources/documents/block_strings_with_variable_default_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_variable_default_value.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/block_strings_with_variable_default_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_variable_default_value.graphql index 6589aac6a..9cf30b215 100644 --- a/ballerina-tests/tests/resources/documents/block_strings_with_variable_default_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/block_strings_with_variable_default_value.graphql @@ -2,4 +2,4 @@ Hello, GraphQL!,""" ){ sendEmail(message: $block) -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/coerce_decimal_to_float.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_decimal_to_float.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/coerce_decimal_to_float.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_decimal_to_float.graphql index cbb164c54..3d931537f 100644 --- a/ballerina-tests/tests/resources/documents/coerce_decimal_to_float.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_decimal_to_float.graphql @@ -1,3 +1,3 @@ ($weight:Float!) { weightInPounds(weightInKg:$weight) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_input_to_float.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_input_to_float.graphql new file mode 100644 index 000000000..2521ad1c0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_input_to_float.graphql @@ -0,0 +1,3 @@ +{ + weightInPounds(weightInKg: 1) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal.graphql new file mode 100644 index 000000000..150632a09 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal.graphql @@ -0,0 +1,3 @@ +{ + convertDecimalToFloat(value: 1) +} diff --git a/ballerina-tests/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql index 5913dbdf0..8ff1efb8b 100644 --- a/ballerina-tests/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal_with_default_value.graphql @@ -1,3 +1,3 @@ ($val:Decimal! = 5) { convertDecimalToFloat(value:$val) -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql index 1d30262db..567f01ca9 100644 --- a/ballerina-tests/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/coerce_int_to_decimal_with_variable_input.graphql @@ -1,3 +1,3 @@ ($val:Decimal!) { convertDecimalToFloat(value:$val) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query.graphql new file mode 100644 index 000000000..43bb1c3d5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query.graphql @@ -0,0 +1,8 @@ +{ + __schema { + types { + name + kind + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query_with_other_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query_with_other_fields.graphql new file mode 100644 index 000000000..53cf1a81d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_introspection_query_with_other_fields.graphql @@ -0,0 +1,11 @@ +{ + __schema { + types { + name + kind + } + } + allVehicles { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_service.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_service.graphql new file mode 100644 index 000000000..0dcf6ffde --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/complex_service.graphql @@ -0,0 +1,8 @@ +{ + profile { + name { + first + last + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_input.graphql new file mode 100644 index 000000000..abbf10be3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_input.graphql @@ -0,0 +1,3 @@ +{ + convertDecimalToFloat(value: 1.33) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_input.graphql new file mode 100644 index 000000000..da936e5a8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_input.graphql @@ -0,0 +1,3 @@ +{ + getTotalInDecimal(prices: [[1.33, 4.8], [5.6, 6], [5, 7, 8]]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_default_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_default_input.graphql new file mode 100644 index 000000000..8937b8db7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_default_input.graphql @@ -0,0 +1,5 @@ +query getTotalInDecimal( + $prices: [[Decimal!]!]! = [[1.3323232, 4.856343], [5.63535, 6], [5, 7, 8]] +) { + getTotalInDecimal(prices: $prices) +} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_list_with_variable_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_variable_input.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/decimal_type_list_with_variable_input.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_variable_input.graphql index fef3a8ad6..9ccc98d93 100644 --- a/ballerina-tests/tests/resources/documents/decimal_type_list_with_variable_input.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_list_with_variable_input.graphql @@ -1,3 +1,3 @@ ($prices:[[Decimal!]!]!) { getTotalInDecimal(prices:$prices) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_default_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_default_value.graphql new file mode 100644 index 000000000..852daa44f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_default_value.graphql @@ -0,0 +1,8 @@ +query getSubTotalWithDefaultValue( + $items: [Item!] = [ + { name: "soap", price: 64.5555332 } + { name: "sugar", price: 154 } + ] +) { + getSubTotal(items: $items) +} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_with_input_object_variable.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_variable.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/decimal_type_with_input_object_variable.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_variable.graphql index 5d950c57c..3ab6bf723 100644 --- a/ballerina-tests/tests/resources/documents/decimal_type_with_input_object_variable.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_type_with_input_object_variable.graphql @@ -1,3 +1,3 @@ ($items:[Item!]!) { getSubTotal(items: $items) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_infinity.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_infinity.graphql new file mode 100644 index 000000000..0c91ecbe9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_infinity.graphql @@ -0,0 +1,3 @@ +{ + convertDecimalToFloat(value: -1.7E309) +} diff --git a/ballerina-tests/tests/resources/documents/decimal_with_negative_zero.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_zero.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/decimal_with_negative_zero.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_zero.graphql index 1d30262db..567f01ca9 100644 --- a/ballerina-tests/tests/resources/documents/decimal_with_negative_zero.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_negative_zero.graphql @@ -1,3 +1,3 @@ ($val:Decimal!) { convertDecimalToFloat(value:$val) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_positive_infinity.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_positive_infinity.graphql new file mode 100644 index 000000000..b7f59e2f4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/decimal_with_positive_infinity.graphql @@ -0,0 +1,3 @@ +{ + convertDecimalToFloat(value: 1.7E309) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/default_values_in_input_object_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/default_values_in_input_object_fields.graphql new file mode 100644 index 000000000..824f22c39 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/default_values_in_input_object_fields.graphql @@ -0,0 +1,3 @@ +{ + name(person: {}) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering.graphql new file mode 100644 index 000000000..8726c53b5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering.graphql @@ -0,0 +1,38 @@ +{ + __schema { + queryType { + ...FieldFragment + } + mutationType { + ...FieldFragment + } + subscriptionType { + ...FieldFragment + } + } + __type(name: "InstrumentType") { + enumValues(includeDeprecated: false) { + name + isDeprecated + deprecationReason + } + } +} + +fragment FieldFragment on __Type { + fields(includeDeprecated: false) { + name + isDeprecated + deprecationReason + type { + ofType { + name + fields(includeDeprecated: false) { + name + isDeprecated + deprecationReason + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql new file mode 100644 index 000000000..70676807f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql @@ -0,0 +1,38 @@ +query ($includeDeprecated: Boolean!) { + __schema { + queryType { + ...FieldFragment + } + mutationType { + ...FieldFragment + } + subscriptionType { + ...FieldFragment + } + } + __type(name: "InstrumentType") { + enumValues(includeDeprecated: $includeDeprecated) { + name + isDeprecated + deprecationReason + } + } +} + +fragment FieldFragment on __Type { + fields(includeDeprecated: $includeDeprecated) { + name + isDeprecated + deprecationReason + type { + ofType { + name + fields(includeDeprecated: $includeDeprecated) { + name + isDeprecated + deprecationReason + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection.graphql new file mode 100644 index 000000000..244d61ea9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection.graphql @@ -0,0 +1,45 @@ +{ + __schema { + queryType { + ...TypeFragment + } + mutationType { + ...TypeFragment + } + subscriptionType { + ...TypeFragment + } + } + t1: __type(name: "InstrumentType") { + enumValues(includeDeprecated: true) { + name + isDeprecated + deprecationReason + } + } + t2: __type(name: "DeprecatedAddress") { + ...TypeFragment + } +} + +fragment TypeFragment on __Type { + fields(includeDeprecated: true) { + name + isDeprecated + deprecationReason + type { + ...FieldTypeFragment + } + } +} + +fragment FieldTypeFragment on __Type { + ofType { + name + fields(includeDeprecated: true) { + name + isDeprecated + deprecationReason + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql new file mode 100644 index 000000000..70676807f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql @@ -0,0 +1,38 @@ +query ($includeDeprecated: Boolean!) { + __schema { + queryType { + ...FieldFragment + } + mutationType { + ...FieldFragment + } + subscriptionType { + ...FieldFragment + } + } + __type(name: "InstrumentType") { + enumValues(includeDeprecated: $includeDeprecated) { + name + isDeprecated + deprecationReason + } + } +} + +fragment FieldFragment on __Type { + fields(includeDeprecated: $includeDeprecated) { + name + isDeprecated + deprecationReason + type { + ofType { + name + fields(includeDeprecated: $includeDeprecated) { + name + isDeprecated + deprecationReason + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directive_locations.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directive_locations.graphql new file mode 100644 index 000000000..12fb7722c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directive_locations.graphql @@ -0,0 +1,7 @@ +{ + __schema { + directives { + locations + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives.graphql new file mode 100644 index 000000000..93be4ed3b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives.graphql @@ -0,0 +1,14 @@ +query getData { + profile @skip(if: false) { + ... on Profile @include(if: true) { + name { + first @include(if: false) + ...lastName @skip(if: false) @include(if: true) + } + } + } +} + +fragment lastName on Name { + last @skip(if: false) @include(if: true) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_skip_all_selections.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_skip_all_selections.graphql new file mode 100644 index 000000000..c76038541 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_skip_all_selections.graphql @@ -0,0 +1,5 @@ +query getData { + profile(id: 1) @skip(if: true) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_duplicate_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_duplicate_fields.graphql new file mode 100644 index 000000000..dad6d482a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_duplicate_fields.graphql @@ -0,0 +1,20 @@ +query getData( + $optional: Boolean! + $require: Boolean = true + $profileId: Int = 1 +) { + ... on Query { + profile(id: $profileId) { + ... on Person @include(if: true) { + name + address @skip(if: $require) { + city + street + } + address @skip(if: $optional) { + number + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_service_returning_objects_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_service_returning_objects_array.graphql new file mode 100644 index 000000000..ff51a2f06 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_service_returning_objects_array.graphql @@ -0,0 +1,7 @@ +{ + searchVehicles(keyword: "vehicle") { + ... on Vehicle { + id @skip(if: true) + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_variables_and_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_variables_and_fragments.graphql new file mode 100644 index 000000000..73cb914e9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/directives_with_variables_and_fragments.graphql @@ -0,0 +1,22 @@ +query getData( + $optional: Boolean! + $require: Boolean = true + $profileId: Int = 1 +) { + ... on Query @include(if: $require) { + profile(id: $profileId) @skip(if: false) { + ... on Person { + name + ...address @include(if: $require) + } + } + } +} + +fragment address on Person { + address { + city @include(if: $optional) + street + number @skip(if: $optional) @include(if: false) + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/documentation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/documentation.graphql new file mode 100644 index 000000000..d5b1e643d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/documentation.graphql @@ -0,0 +1,48 @@ +{ + __schema { + description + queryType { + fields { + ...FieldFragment + } + } + mutationType { + fields { + ...FieldFragment + } + } + } +} + +fragment FieldFragment on __Field { + name + description + type { + ...FieldTypeFragment + } + args { + name + description + } +} + +fragment FieldTypeFragment on __Type { + name + description + fields { + name + description + } + ofType { + ...TypeFragment + } +} + +fragment TypeFragment on __Type { + name + description + fields { + name + description + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_arguments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_arguments.graphql new file mode 100644 index 000000000..11b05ed92 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_arguments.graphql @@ -0,0 +1,149 @@ +query duplicateFieldsWithScalarArgs1 { + greet(name: "Ballerina") + greet(name: "GraphQL") + name + name(name: "GraphQL") +} + +query duplicateFieldsWithScalarArgs2($Name: String!) { + name(name: "Ballerina") + name(name: $Name) +} + +query duplicateFieldsWithScalarArgs3($Name: String! = "Ballerina") { + name(name: "Ballerina") + name(name: $Name) +} + +query duplicateFieldsWithEnumArgs1 { + isHoliday(weekday: FRIDAY) + isHoliday(weekday: SATURDAY) +} + +query duplicateFieldsWithEnumArgs2 { + isHoliday(weekday: null) + isHoliday(weekday: null) + isHoliday +} + +query duplicateFieldsWithEnumArgs3($day: Weekday!, $weekday: Weekday!) { + isHoliday(weekday: $day) + isHoliday(weekday: $weekday) +} + +query duplicateFieldsWithInputObjectArgs1 { + book(info: { bookName: "Sherlock", edition: 4, author: { name: "Arthur" } }) { + name + } + book(info: { bookName: "Sherlock", edition: 4, author: { name: "Arthur" } }) { + name + } + book( + info: { + bookName: "Sherlock" + edition: 4 + author: { name: "Arthur", age: 45 } + } + ) { + name + } +} + +query duplicateFieldsWithInputObjectArgs2($name: String! = "Arthur") { + book(info: { bookName: "Sherlock", edition: 4, author: { name: "Arthur" } }) { + name + } + book(info: { bookName: "Sherlock", edition: 4, author: { name: "Arthur" } }) { + name + } + book(info: { bookName: "Sherlock", edition: 4, author: { name: $name } }) { + name + } +} + +query duplicateFieldsWithInputObjectArgs3( + $bName: String = "Avengers" + $bAuthor: ProfileDetail! +) { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + name + } + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + name + } + book( + info: { + bookName: "Avengers" + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + name + } +} + +query duplicateFieldsWithInputObjectArgs4 { + book( + info: { + bookName: "Sherlock" + edition: 4 + author: { name: "Arthur", age: 45 } + movie: { movieName: "Sherlock Holmes" } + } + ) { + name + } + book( + info: { + bookName: "Sherlock" + edition: 4 + author: { name: "Arthur", age: 45 } + movie: { movieName: "Sherlock Holmes", director: "Ritchie" } + } + ) { + name + } + name(person: {}) + name(person: {}) + name(person: { name: "Sam", addresses: [] }) +} + +query duplicateFieldsWithListArgs1 { + concat(words: null) + concat(words: null) + concat(words: [null, "gql"]) + concat(words: [null, null]) +} + +query duplicateFieldsWithListArgs2 { + concat(words: ["Ballerina", "GraphQL"]) + concat(words: ["GraphQL", "Ballerina"]) + getTotal(prices: [[4, 5, 6, 7], [2, 3, 4], [3, 5, 6, 4, 2, 7]]) + getTotal(prices: [[4, 5, 6, 7], [2, 3, 4], [3, 5, 6, 4, 7, 2]]) +} + +query duplicateFieldsWithListArgs3 { + getTotal(prices: [[2, 3, 4], [4, 5, 6, 7], [3, 5, 6, 4, 2, 7]]) + getTotal(prices: [[2, 3, 4], [4, 5, 6, 7], [3, 5, 6, 4, 2, 7]]) + getTotal(prices: [[4, 5, 6, 7], [2, 3, 4], [3, 5, 6, 4, 2, 7]]) + getTotal(prices: [[4, 5, 6, 7], [2, 4, 3], [3, 5, 6, 4, 2, 7]]) + getTotal(prices: [[4, 5, 6, 7], [2, 3], [3, 5, 6, 4, 2, 7]]) + total: getTotal(prices: [[4, 5, 7, 8], [2, 3, 4], [3, 5, 6, 4, 2, 7]]) + total: getTotal(prices: [[4, 5, 6, 7], [3, 5, 6, 4, 2, 7]]) + total: getTotal(prices: [[4, 5, 7], [2, 4, 3], [3, 5, 6, 4, 2, 7]]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_record_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_record_types.graphql new file mode 100644 index 000000000..c26c0bcbf --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_fields_with_record_types.graphql @@ -0,0 +1,22 @@ +query getPerson { + profile { + name { + first + } + name { + first + } + name { + last + } + address { + city + } + address { + street + } + address { + city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_inline_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_inline_fragments.graphql new file mode 100644 index 000000000..a9c6e0177 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_inline_fragments.graphql @@ -0,0 +1,25 @@ +query { + ... on Query { + people { + ... on Person { + address { + street + } + address { + number + street + } + address { + number + street + city + } + } + } + } + ... on Query { + students { + name + } + } +} diff --git a/ballerina-tests/tests/resources/documents/duplicate_input_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_input_variables.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/duplicate_input_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_input_variables.graphql index 8dfb2e47d..cc0c444f7 100644 --- a/ballerina-tests/tests/resources/documents/duplicate_input_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_input_variables.graphql @@ -1,3 +1,3 @@ ($userName:String!, $userName:Int!) { greet (name: $userName) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql new file mode 100644 index 000000000..b3ddf5b0c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql @@ -0,0 +1,19 @@ +query A($profileId: Int!) { + ...data +} + +query B($profileId: Int!) { + ...data +} + +fragment data on Query { + profile(id: $profileId) { + ...people + } +} + +fragment people on Person { + address { + city + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_block_string.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_block_string.graphql new file mode 100644 index 000000000..da2a6038a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_block_string.graphql @@ -0,0 +1,6 @@ +{ + sendEmail( + message: """ + """ + ) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects.graphql new file mode 100644 index 000000000..0a3ac4bf8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects.graphql @@ -0,0 +1,11 @@ +query { + getMovie( + tvSeries: { + name: "Breaking Bad" + episodes: [{ title: "Cancer Man", newCharacters: [] }] + } + ) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql new file mode 100644 index 000000000..654984afb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql @@ -0,0 +1,6 @@ +query ($tvSeries: TvSeries!) { + getMovie(tvSeries: $tvSeries) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_string.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_string.graphql new file mode 100644 index 000000000..384bf09c9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/empty_string.graphql @@ -0,0 +1,3 @@ +{ + sendEmail(message: "") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum.graphql new file mode 100644 index 000000000..3494c8835 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum.graphql @@ -0,0 +1,5 @@ +query { + time { + weekday + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter.graphql new file mode 100644 index 000000000..8a0730899 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter.graphql @@ -0,0 +1,3 @@ +query { + isHoliday(weekday: SUNDAY) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter_as_string.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter_as_string.graphql new file mode 100644 index 000000000..ea98c581e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_input_parameter_as_string.graphql @@ -0,0 +1,3 @@ +query { + isHoliday(weekday: "SUNDAY") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_inside_record.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_inside_record.graphql new file mode 100644 index 000000000..41648225d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_inside_record.graphql @@ -0,0 +1,3 @@ +query { + weekday(number: 3) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_introspection.graphql new file mode 100644 index 000000000..3ef186669 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_introspection.graphql @@ -0,0 +1,10 @@ +{ + __schema { + types { + name + enumValues { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_invalid_input_parameter.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_invalid_input_parameter.graphql new file mode 100644 index 000000000..134c4c536 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_invalid_input_parameter.graphql @@ -0,0 +1,3 @@ +query { + isHoliday(weekday: FUNDAY) +} diff --git a/ballerina-tests/tests/resources/documents/enum_type_default_value_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_type_default_value_with_variables.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/enum_type_default_value_with_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_type_default_value_with_variables.graphql index 7dbf002a7..1f18bc456 100644 --- a/ballerina-tests/tests/resources/documents/enum_type_default_value_with_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_type_default_value_with_variables.graphql @@ -1,3 +1,3 @@ ($day:Weekday = SUNDAY) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/enum_type_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_type_variables.graphql similarity index 95% rename from ballerina-tests/tests/resources/documents/enum_type_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_type_variables.graphql index 3234203ff..2350619eb 100644 --- a/ballerina-tests/tests/resources/documents/enum_type_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_type_variables.graphql @@ -1,3 +1,3 @@ ($day:Weekday) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_value_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_value_introspection.graphql new file mode 100644 index 000000000..64ad587f0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_value_introspection.graphql @@ -0,0 +1,7 @@ +{ + __schema { + types { + enumValues + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_union.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_union.graphql new file mode 100644 index 000000000..da7591d54 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_union.graphql @@ -0,0 +1,3 @@ +query { + day(number: 10) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned.graphql new file mode 100644 index 000000000..c6e5d7acd --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned.graphql @@ -0,0 +1,3 @@ +{ + month(month: JANUARY) +} diff --git a/ballerina-tests/tests/resources/documents/enum_with_values_assigned_using_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned_using_variables.graphql similarity index 58% rename from ballerina-tests/tests/resources/documents/enum_with_values_assigned_using_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned_using_variables.graphql index 704fb0636..8a48526ef 100644 --- a/ballerina-tests/tests/resources/documents/enum_with_values_assigned_using_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/enum_with_values_assigned_using_variables.graphql @@ -1,3 +1,3 @@ query GetMonth($month: Month!) { - month(month: $month) + month(month: $month) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_as_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_as_input.graphql new file mode 100644 index 000000000..2841ee6a2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_as_input.graphql @@ -0,0 +1,3 @@ +{ + weightInPounds(weightInKg: 1.3) +} diff --git a/ballerina-tests/tests/resources/documents/float_type_variable_with_default_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_type_variable_with_default_value.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/float_type_variable_with_default_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_type_variable_with_default_value.graphql index 35b641782..b0d461127 100644 --- a/ballerina-tests/tests/resources/documents/float_type_variable_with_default_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/float_type_variable_with_default_value.graphql @@ -1,3 +1,3 @@ ($weight:Float = 4.3534) { weightInPounds(weightInKg: $weight) -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/fragment_on_invalid_type.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_on_invalid_type.graphql similarity index 65% rename from ballerina-tests/tests/resources/documents/fragment_on_invalid_type.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_on_invalid_type.graphql index a59843d5f..e42257e33 100644 --- a/ballerina-tests/tests/resources/documents/fragment_on_invalid_type.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_on_invalid_type.graphql @@ -1,7 +1,7 @@ query { - ...data + ...data } fragment data on Person { - name + name } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_with_invalid_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_with_invalid_field.graphql new file mode 100644 index 000000000..58ac33549 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragment_with_invalid_field.graphql @@ -0,0 +1,9 @@ +query { + ...data +} + +fragment data on Query { + people { + invalid + } +} diff --git a/ballerina-tests/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql similarity index 58% rename from ballerina-tests/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql index 3db2b5a8c..46ba58a53 100644 --- a/ballerina-tests/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_inside_fragments_when_returning_services.graphql @@ -1,17 +1,17 @@ query { - ... QueryFragment + ...QueryFragment } fragment QueryFragment on Query { - teacher { - ...TeacherFragment - } + teacher { + ...TeacherFragment + } } fragment TeacherFragment on TeacherService { - ...NameFragment + ...NameFragment } fragment NameFragment on TeacherService { - name + name } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_on_record_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_on_record_objects.graphql new file mode 100644 index 000000000..2772b10c7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_on_record_objects.graphql @@ -0,0 +1,9 @@ +query { + ...data +} + +fragment data on Query { + people { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/fragments_querying_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_querying_service_objects.graphql similarity index 50% rename from ballerina-tests/tests/resources/documents/fragments_querying_service_objects.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_querying_service_objects.graphql index c1b55f954..cdb9adef4 100644 --- a/ballerina-tests/tests/resources/documents/fragments_querying_service_objects.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_querying_service_objects.graphql @@ -1,19 +1,19 @@ query { - ...greetingFragment + ...greetingFragment } fragment greetingFragment on Query { - profile { - ...nameFragment - } + profile { + ...nameFragment + } } fragment nameFragment on Profile { - name { - ...fullNameFragment - } + name { + ...fullNameFragment + } } fragment fullNameFragment on Name { - first + first } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_input_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_input_variables.graphql new file mode 100644 index 000000000..faf3d1aef --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_input_variables.graphql @@ -0,0 +1,15 @@ +query ($profileId: Int!) { + ...data +} + +fragment data on Query { + profile(id: $profileId) { + ...people + } +} + +fragment people on Person { + address { + city + } +} diff --git a/ballerina-tests/tests/resources/documents/fragments_with_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_introspection.graphql similarity index 51% rename from ballerina-tests/tests/resources/documents/fragments_with_introspection.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_introspection.graphql index edb9decf3..cdee84c90 100644 --- a/ballerina-tests/tests/resources/documents/fragments_with_introspection.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_introspection.graphql @@ -1,19 +1,19 @@ query { - ...data + ...data } fragment data on Query { - ...schema + ...schema } fragment schema on Query { - __schema { - ...types - } + __schema { + ...types + } } fragment types on __Schema { - types { - name - } + types { + name + } } diff --git a/ballerina-tests/tests/resources/documents/fragments_with_invalid_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_invalid_introspection.graphql similarity index 50% rename from ballerina-tests/tests/resources/documents/fragments_with_invalid_introspection.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_invalid_introspection.graphql index 18acd0004..8d7696e13 100644 --- a/ballerina-tests/tests/resources/documents/fragments_with_invalid_introspection.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_invalid_introspection.graphql @@ -1,19 +1,19 @@ query { - ...data + ...data } fragment data on Query { - ...schema + ...schema } fragment schema on Query { - __schema { - ...types - } + __schema { + ...types + } } fragment types on __Schema { - types { - invalid - } + types { + invalid + } } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql new file mode 100644 index 000000000..321072458 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql @@ -0,0 +1,23 @@ +query { + ...data +} + +fragment data on Query { + people { + ...people + } + + students { + ...student + } +} + +fragment people on Person { + address { + city + } +} + +fragment student on Student { + name +} diff --git a/ballerina-tests/tests/resources/documents/resolver_returning_tables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/functions_with_input_parameter.graphql similarity index 55% rename from ballerina-tests/tests/resources/documents/resolver_returning_tables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/functions_with_input_parameter.graphql index 747383548..e4a8a9743 100644 --- a/ballerina-tests/tests/resources/documents/resolver_returning_tables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/functions_with_input_parameter.graphql @@ -1,5 +1,3 @@ { - all { - isoCode - } + greet(name: "Thisaru") } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql new file mode 100644 index 000000000..d17da75f3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/graphql_playground_introspection_query.graphql @@ -0,0 +1,99 @@ +query IntrospectionQuery { + __schema { + queryType { + name + } + mutationType { + name + } + subscriptionType { + name + } + types { + ...FullType + } + directives { + name + description + locations + args { + ...InputValue + } + } + } +} + +fragment FullType on __Type { + kind + name + description + fields(includeDeprecated: true) { + name + description + args { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + description + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } +} + +fragment InputValue on __InputValue { + name + description + type { + ...TypeRef + } + defaultValue +} + +fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql new file mode 100644 index 000000000..91bc26445 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql @@ -0,0 +1,9 @@ +{ + profile { + name { + address { + street + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths.graphql new file mode 100644 index 000000000..c16c62f84 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths.graphql @@ -0,0 +1,7 @@ +{ + profile { + name { + first + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_complete.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_complete.graphql new file mode 100644 index 000000000..cd0601c1f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_complete.graphql @@ -0,0 +1,9 @@ +{ + profile { + name { + first + last + } + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_introspection.graphql new file mode 100644 index 000000000..06629cf80 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_introspection.graphql @@ -0,0 +1,10 @@ +{ + __schema { + types { + name + fields { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql new file mode 100644 index 000000000..71edca283 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql @@ -0,0 +1,9 @@ +{ + profile { + personal { + name { + first + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql new file mode 100644 index 000000000..4f476249b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql @@ -0,0 +1,16 @@ +{ + profile { + ...ProfileFragment + } +} + +fragment ProfileFragment on profile { + name { + ...NameFragment + } +} + +fragment NameFragment on name { + first + last +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql new file mode 100644 index 000000000..0dcf6ffde --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql @@ -0,0 +1,8 @@ +{ + profile { + name { + first + last + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql new file mode 100644 index 000000000..f2fe51a06 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql @@ -0,0 +1,9 @@ +{ + mountain { + trail { + getLift { + name + } + } + } +} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_null_value1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql similarity index 50% rename from ballerina-tests/tests/resources/documents/interceptors_with_null_value1.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql index 8594597c7..e7ae99a2a 100644 --- a/ballerina-tests/tests/resources/documents/interceptors_with_null_value1.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql @@ -1,3 +1,5 @@ { + lift { name + } } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal.graphql new file mode 100644 index 000000000..228be6bfe --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal.graphql @@ -0,0 +1,3 @@ +query { + decimalId(decimalId: "45.0") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_array.graphql new file mode 100644 index 000000000..3c19cb8c0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_array.graphql @@ -0,0 +1,7 @@ +query { + decimalArrayReturnRecord(decimalId: ["0.8", "5.0", "6.9"]) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql new file mode 100644 index 000000000..6438be2ea --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql @@ -0,0 +1,3 @@ +query { + decimalId1(decimalId: "45.0") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float.graphql new file mode 100644 index 000000000..d64bdc4a0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float.graphql @@ -0,0 +1,3 @@ +query { + floatId(floatId: "6.0") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array.graphql new file mode 100644 index 000000000..19e04abcf --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array.graphql @@ -0,0 +1,7 @@ +query { + floatArrayReturnRecord(floatId: ["0.8", "5.0", "6.9"]) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array1.graphql new file mode 100644 index 000000000..0c5bea4b2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_array1.graphql @@ -0,0 +1,7 @@ +query ($ids: [ID!]!) { + floatArrayReturnRecordArray(floatIds: $ids) { + name + id + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_or_nil.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_or_nil.graphql new file mode 100644 index 000000000..16d1ab278 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_float_or_nil.graphql @@ -0,0 +1,3 @@ +query { + floatId1(floatId: "6.0") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int.graphql new file mode 100644 index 000000000..ddf4bb1b3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int.graphql @@ -0,0 +1,3 @@ +query { + intId(intId: 56) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int1.graphql new file mode 100644 index 000000000..96e5ce04c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int1.graphql @@ -0,0 +1,7 @@ +query { + intIdReturnRecord(intId: 67) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_array.graphql new file mode 100644 index 000000000..0d6f5d553 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_array.graphql @@ -0,0 +1,7 @@ +query { + intArrayReturnRecord(intId: [2, 3]) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_or_nil.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_or_nil.graphql new file mode 100644 index 000000000..b6b702232 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_int_or_nil.graphql @@ -0,0 +1,3 @@ +query { + intId1(intId: 56) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record.graphql new file mode 100644 index 000000000..d6516bdce --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record.graphql @@ -0,0 +1,7 @@ +query { + stringIdReturnRecord(stringId: "String ID") { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record_array.graphql new file mode 100644 index 000000000..75c5a237e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_return_record_array.graphql @@ -0,0 +1,7 @@ +query { + stringArrayReturnRecordArray(stringIds: ["One", "Two", "Three"]) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string.graphql new file mode 100644 index 000000000..0af3b8a66 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string.graphql @@ -0,0 +1,3 @@ +query { + stringId(stringId: "hello") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_array.graphql new file mode 100644 index 000000000..68a0b4852 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_array.graphql @@ -0,0 +1,7 @@ +query { + stringArrayReturnRecord(stringId: ["Hello", "World"]) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_or_nil.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_or_nil.graphql new file mode 100644 index 000000000..2a92f56dc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_string_or_nil.graphql @@ -0,0 +1,3 @@ +query { + stringId1(stringId: "hello") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid.graphql new file mode 100644 index 000000000..ba6a27509 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid.graphql @@ -0,0 +1,9 @@ +query { + uuidReturnRecord( + uuidId: "{\"timeLow\":32377426,\"timeMid\":55867,\"timeHiAndVersion\":6608,\"clockSeqHiAndReserved\":131,\"clockSeqLo\":89,\"node\":143363128380312}" + ) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array.graphql new file mode 100644 index 000000000..0ca4c410c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array.graphql @@ -0,0 +1,11 @@ +query { + uuidArrayReturnRecord( + uuidId: [ + "{\"timeLow\":32377426,\"timeMid\":55867,\"timeHiAndVersion\":6608,\"clockSeqHiAndReserved\":131,\"clockSeqLo\":89,\"node\":143363128380312}" + ] + ) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql new file mode 100644 index 000000000..4cefe774c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql @@ -0,0 +1,11 @@ +query { + uuidArrayReturnRecord1( + uuidId: [ + "{\"timeLow\":32377426,\"timeMid\":55867,\"timeHiAndVersion\":6608,\"clockSeqHiAndReserved\":131,\"clockSeqLo\":89,\"node\":143363128380312}" + ] + ) { + __typename + id + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_introspection_query.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_introspection_query.graphql new file mode 100644 index 000000000..f029f344c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/id_introspection_query.graphql @@ -0,0 +1,41 @@ +query IntrospectionQuery { + __schema { + types { + ...FullType + } + } +} + +fragment FullType on __Type { + kind + name + fields(includeDeprecated: true) { + name + args { + ...InputValue + } + type { + ...TypeRef + } + } + inputFields { + ...InputValue + } +} + +fragment InputValue on __InputValue { + name + type { + ...TypeRef + } + defaultValue +} + +fragment TypeRef on __Type { + kind + name + ofType { + kind + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragment.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragment.graphql new file mode 100644 index 000000000..82b0a0eec --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragment.graphql @@ -0,0 +1,17 @@ +query { + ... on Query { + people { + ... on Person { + address { + city + } + } + } + } + + ... on Query { + students { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_on_record_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_on_record_objects.graphql new file mode 100644 index 000000000..734e0fdff --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_on_record_objects.graphql @@ -0,0 +1,12 @@ +query { + teacher { + ... on Person { + name + } + } + student { + ... on Person { + age + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_with_variables.graphql new file mode 100644 index 000000000..58235c8b7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_fragments_with_variables.graphql @@ -0,0 +1,14 @@ +query getData($profileId: Int!) { + ... on Query { + profile(id: $profileId) { + ... on Person { + name + address { + ... on Address { + city + } + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql new file mode 100644 index 000000000..f59ac62c6 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql @@ -0,0 +1,22 @@ +query { + teacher { + ... on Person { + name + address { + ... on Address { + city + } + } + } + } + student { + ... on Person { + age + address { + ... on Address { + city + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object.graphql new file mode 100644 index 000000000..c12ea94f3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object.graphql @@ -0,0 +1,5 @@ +{ + searchProfile(profileDetail: { name: "Jessie", age: 28 }) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql new file mode 100644 index 000000000..69f85e79e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql @@ -0,0 +1,12 @@ +query getBook($bName: String!, $bAuthor: ProfileDetail!) { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql new file mode 100644 index 000000000..0e37f75f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql @@ -0,0 +1,11 @@ +query getBook($authorAge: Int) { + book( + info: { + bookName: $bName + edition: 6 + author: { name: "Arthur Conan Doyle", age: $authorAge } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_variables.graphql new file mode 100644 index 000000000..70078d162 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_include_fields_with_variables.graphql @@ -0,0 +1,12 @@ +query getBook($bName: String!, $authorAge: Int) { + book( + info: { + bookName: $bName + edition: 6 + author: { name: "Arthur Conan Doyle", age: $authorAge } + movie: { movieName: "Sherlock" } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_type_variables_inside_list_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_type_variables_inside_list_value.graphql new file mode 100644 index 000000000..c90e33158 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_type_variables_inside_list_value.graphql @@ -0,0 +1,5 @@ +query ($series1: TvSeries!) { + getSuggestions(tvSeries: [$series1]) { + movieName + } +} diff --git a/ballerina-tests/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql index c264f4784..be6eb2a20 100644 --- a/ballerina-tests/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_variables_with_invalid_type_name.graphql @@ -2,4 +2,4 @@ searchProfile(profileDetail: $profile) { name } -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_default_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_default_value.graphql new file mode 100644 index 000000000..e9e07800f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_default_value.graphql @@ -0,0 +1,15 @@ +query getBook( + $bName: String = "Harry" + $bAuthor: ProfileDetail = { name: "J.K Rowling" } +) { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_duplicate_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_duplicate_fields.graphql new file mode 100644 index 000000000..877955ae3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_duplicate_fields.graphql @@ -0,0 +1,13 @@ +query getBook($bName: String, $bAuthor: ProfileDetail) { + book( + info: { + bookName: $bName + bookName: "Sherlock Return" + edition: 6 + author: $bAuthor + movie: { movieName: "End Game", movieName: "Venom" } + } + ) { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_enum_type_argument.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_enum_type_argument.graphql similarity index 95% rename from ballerina-tests/tests/resources/documents/input_object_with_enum_type_argument.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_enum_type_argument.graphql index 55643b29f..451678370 100644 --- a/ballerina-tests/tests/resources/documents/input_object_with_enum_type_argument.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_enum_type_argument.graphql @@ -1,3 +1,3 @@ ($day:Date!) { isHoliday(date: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/input_object_with_float_type_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_float_type_variables.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/input_object_with_float_type_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_float_type_variables.graphql index 00aa181fc..0ace0d07b 100644 --- a/ballerina-tests/tests/resources/documents/input_object_with_float_type_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_float_type_variables.graphql @@ -1,3 +1,3 @@ ($weight:Weight!) { weightInPounds (weight:$weight) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_fragment_and_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_fragment_and_variables.graphql new file mode 100644 index 000000000..cc36eb853 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_fragment_and_variables.graphql @@ -0,0 +1,21 @@ +query getBook($bName: String!, $bAuthor: ProfileDetail!) { + ...data +} + +fragment data on Query { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + ...bookDetails + } +} + +fragment bookDetails on Book { + name + author +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql new file mode 100644 index 000000000..f38209eb3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql @@ -0,0 +1,16 @@ +query getBook($bName: String!, $bAuthor: ProfileDetail!, $dir: String) { + ... on Query { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game", director: $dir } + } + ) { + ... on Book { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments1.graphql new file mode 100644 index 000000000..999ba8d2a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments1.graphql @@ -0,0 +1,5 @@ +{ + searchProfile(profileDetail: { name: 5, age: "Arthur" }) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments2.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments2.graphql new file mode 100644 index 000000000..40ac1c850 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_arguments2.graphql @@ -0,0 +1,12 @@ +query getBook($bAuthor: ProfileDetail = { name: {}, age: {} }) { + book( + info: { + bookName: { name: "s" } + edition: {} + author: $bAuthor + movie: { movieName: {} } + } + ) { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables1.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables1.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables1.graphql index 221c16e44..0d094be1a 100644 --- a/ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables1.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables1.graphql @@ -1,3 +1,3 @@ ($weight:WeightInKg!) { convertKgToGram (weight:$weight) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables2.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables2.graphql new file mode 100644 index 000000000..8935f179a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_invalid_type_variables2.graphql @@ -0,0 +1,16 @@ +query getBook( + $bName: String = "Harry" + $bAuthor: ProfileDetail! + $dir: String +) { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game", director: $dir } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_arguments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_arguments.graphql new file mode 100644 index 000000000..697dc5e4a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_arguments.graphql @@ -0,0 +1,5 @@ +{ + searchProfile(profileDetail: { age: 34 }) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql new file mode 100644 index 000000000..693817ea2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql @@ -0,0 +1,16 @@ +query getBook( + $bName: String = "Harry" + $bAuthor: ProfileDetail = { name: "J.K Rowling" } + $dir: String +) { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game", director: $dir } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_variables_arguments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_variables_arguments.graphql new file mode 100644 index 000000000..69f85e79e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_missing_variables_arguments.graphql @@ -0,0 +1,12 @@ +query getBook($bName: String!, $bAuthor: ProfileDetail!) { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game" } + } + ) { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_nested_input_object_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_input_object_variables.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/input_object_with_nested_input_object_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_input_object_variables.graphql index 4280a5024..f5d9b8513 100644 --- a/ballerina-tests/tests/resources/documents/input_object_with_nested_input_object_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_input_object_variables.graphql @@ -2,4 +2,4 @@ book(info:$info) { name } -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_object.graphql new file mode 100644 index 000000000..fe29b2fcd --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_nested_object.graphql @@ -0,0 +1,13 @@ +query getBook { + book( + info: { + bookName: "Harry" + edition: 6 + author: { name: "Sherlock" } + movie: { movieName: "Venom", director: "Dexter Fletcher" } + } + ) { + name + author + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_undefined_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_undefined_fields.graphql new file mode 100644 index 000000000..31d3b9f3c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_undefined_fields.graphql @@ -0,0 +1,12 @@ +query getBook($bName: String!) { + book( + info: { + bookName: $bName + edition: 6 + author: { name: "Arthur Conan Doyle", address: "London" } + movie: { movieName: "Sherlock", year: 2005 } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_unexpected_variable_values.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_unexpected_variable_values.graphql new file mode 100644 index 000000000..f38209eb3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_unexpected_variable_values.graphql @@ -0,0 +1,16 @@ +query getBook($bName: String!, $bAuthor: ProfileDetail!, $dir: String) { + ... on Query { + book( + info: { + bookName: $bName + edition: 6 + author: $bAuthor + movie: { movieName: "End Game", director: $dir } + } + ) { + ... on Book { + name + } + } + } +} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_variables.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/input_object_with_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_variables.graphql index a30ada122..192691a49 100644 --- a/ballerina-tests/tests/resources/documents/input_object_with_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_with_variables.graphql @@ -2,4 +2,4 @@ searchProfile(profileDetail:$profile) { name } -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_without_optional_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_without_optional_fields.graphql new file mode 100644 index 000000000..58b9a582c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_object_without_optional_fields.graphql @@ -0,0 +1,11 @@ +{ + book( + info: { + bookName: "Study in Scarlet" + edition: 6 + author: { name: "Arthur Conan Doyle", age: 67 } + } + ) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql new file mode 100644 index 000000000..b040def49 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql @@ -0,0 +1,3 @@ +{ + isLegal(age: 21) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_escape_characters.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_escape_characters.graphql new file mode 100644 index 000000000..dbb23aff2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_escape_characters.graphql @@ -0,0 +1,3 @@ +{ + type(version: "1.0.0") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_unicode_characters.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_unicode_characters.graphql new file mode 100644 index 000000000..8b641f424 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/input_with_unicode_characters.graphql @@ -0,0 +1,3 @@ +{ + version(name: "SwanLake") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_field.graphql new file mode 100644 index 000000000..d9a09e780 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_field.graphql @@ -0,0 +1,5 @@ +{ + characters { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_introspection.graphql new file mode 100644 index 000000000..d38739e82 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interface_introspection.graphql @@ -0,0 +1,12 @@ +{ + __schema { + types { + name + kind + possibleTypes { + name + kind + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces.graphql new file mode 100644 index 000000000..1f4ee18e5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces.graphql @@ -0,0 +1,16 @@ +{ + characters { + ...HumanFragment + ...DroidFragment + } +} + +fragment HumanFragment on Human { + name + id +} + +fragment DroidFragment on Droid { + name + year +} diff --git a/ballerina-tests/tests/resources/documents/interfaces_implementing_interface_introsepction.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_implementing_interface_introsepction.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/interfaces_implementing_interface_introsepction.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_implementing_interface_introsepction.graphql diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_interface_type_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_interface_type_array.graphql new file mode 100644 index 000000000..e1efe223f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_interface_type_array.graphql @@ -0,0 +1,13 @@ +{ + ships { + id + ... on Starship { + enemyShips { + id + ... on Starship { + driver + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_invalid_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_invalid_field.graphql new file mode 100644 index 000000000..a97987753 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_invalid_field.graphql @@ -0,0 +1,20 @@ +{ + characters { + ...CharacterFragment + } +} + +fragment CharacterFragment on Character { + name + age + ...HumanFragment + ...DroidFragment +} + +fragment HumanFragment on Human { + id +} + +fragment DroidFragment on Droid { + year +} diff --git a/ballerina-tests/tests/resources/documents/interfaces_with_nested_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_nested_fragments.graphql similarity index 50% rename from ballerina-tests/tests/resources/documents/interfaces_with_nested_fragments.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_nested_fragments.graphql index 263af3190..ba83e5568 100644 --- a/ballerina-tests/tests/resources/documents/interfaces_with_nested_fragments.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_nested_fragments.graphql @@ -1,19 +1,19 @@ { - characters { - ...CharacterFragment - } + characters { + ...CharacterFragment + } } fragment CharacterFragment on Character { - name - ...HumanFragment - ...DroidFragment + name + ...HumanFragment + ...DroidFragment } fragment HumanFragment on Human { - id + id } fragment DroidFragment on Droid { - year + year } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_type_name_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_type_name_introspection.graphql new file mode 100644 index 000000000..d3309e80a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/interfaces_with_type_name_introspection.graphql @@ -0,0 +1,20 @@ +{ + characters { + ...CharacterFragment + } +} + +fragment CharacterFragment on Character { + __typename + name + ...HumanFragment + ...DroidFragment +} + +fragment HumanFragment on Human { + id +} + +fragment DroidFragment on Droid { + year +} diff --git a/ballerina-tests/tests/resources/documents/intersection_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/intersection_types.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/intersection_types.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/intersection_types.graphql diff --git a/ballerina-tests/tests/resources/documents/introspection_on_input_object_having_defaultable_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_input_object_having_defaultable_fields.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/introspection_on_input_object_having_defaultable_fields.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_input_object_having_defaultable_fields.graphql diff --git a/ballerina-tests/tests/resources/documents/introspection_on_inputs_with_default_values.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_inputs_with_default_values.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/introspection_on_inputs_with_default_values.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_inputs_with_default_values.graphql diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_service_with_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_service_with_input_objects.graphql new file mode 100644 index 000000000..db0cf63d8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_on_service_with_input_objects.graphql @@ -0,0 +1,13 @@ +{ + __schema { + types { + name + inputFields { + name + type { + kind + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_query_with_missing_selection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_query_with_missing_selection.graphql new file mode 100644 index 000000000..3ee040586 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/introspection_query_with_missing_selection.graphql @@ -0,0 +1,3 @@ +{ + __schema +} diff --git a/ballerina-tests/tests/resources/documents/invalid_block_strings.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_block_strings.graphql similarity index 98% rename from ballerina-tests/tests/resources/documents/invalid_block_strings.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_block_strings.graphql index d835eae63..02de13426 100644 --- a/ballerina-tests/tests/resources/documents/invalid_block_strings.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_block_strings.graphql @@ -4,4 +4,4 @@ """ Yours, GraphQL""") -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql index e2efdc5d5..50bcb8fb0 100644 --- a/ballerina-tests/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_enum_type_default_value_with_variables.graphql @@ -1,3 +1,3 @@ ($day:Weekday = SNDAY) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_hierarchical_resource_paths.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_hierarchical_resource_paths.graphql new file mode 100644 index 000000000..a4527edd8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_hierarchical_resource_paths.graphql @@ -0,0 +1,8 @@ +{ + profile { + name { + first + middle + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_introspection_query.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_introspection_query.graphql new file mode 100644 index 000000000..ef365542c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_introspection_query.graphql @@ -0,0 +1,5 @@ +{ + __schema { + greet + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_for_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_for_input_objects.graphql new file mode 100644 index 000000000..291336616 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_for_input_objects.graphql @@ -0,0 +1,13 @@ +query { + getMovie( + tvSeries: [ + { + name: "Breaking Bad" + episodes: [{ title: "Cancer Man", newCharacters: [true, graphql] }] + } + ] + ) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects.graphql new file mode 100644 index 000000000..63ad19e59 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects.graphql @@ -0,0 +1,11 @@ +query { + getMovie( + tvSeries: { + name: "Breaking Bad" + episodes: [{ title: "Cancer Man", newCharacters: [true, graphql] }] + } + ) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql new file mode 100644 index 000000000..654984afb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql @@ -0,0 +1,6 @@ +query ($tvSeries: TvSeries!) { + getMovie(tvSeries: $tvSeries) { + movieName + director + } +} diff --git a/ballerina-tests/tests/resources/documents/invalid_mutation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_mutation.graphql similarity index 54% rename from ballerina-tests/tests/resources/documents/invalid_mutation.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_mutation.graphql index 16d4fa2d5..61ac2a87e 100644 --- a/ballerina-tests/tests/resources/documents/invalid_mutation.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_mutation.graphql @@ -1,3 +1,3 @@ mutation { - setAge + setAge } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_from_service_object_resource.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_from_service_object_resource.graphql new file mode 100644 index 000000000..20e4b89ad --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_from_service_object_resource.graphql @@ -0,0 +1,7 @@ +{ + profile { + name { + nonExisting + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql new file mode 100644 index 000000000..3aef2699a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql @@ -0,0 +1,5 @@ +query { + profile(id: 200) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_schema_introspection_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_schema_introspection_field.graphql new file mode 100644 index 000000000..c4efdfd46 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_schema_introspection_field.graphql @@ -0,0 +1,10 @@ +{ + profile(id: 1) { + name + __schema { + queryType { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_spread_inline_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_spread_inline_fragments.graphql new file mode 100644 index 000000000..cd7683d5d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_spread_inline_fragments.graphql @@ -0,0 +1,12 @@ +query { + __schema { + types { + ... on Student { + name + } + ... on Person { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql new file mode 100644 index 000000000..659e770d4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql @@ -0,0 +1,11 @@ +query { + getMovie( + tvSeries: { + name: "Breaking Bad" + episodes: { title: "Cancer Man", newCharacters: ["paul"] } + } + ) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_variables_inside_list_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_variables_inside_list_value.graphql new file mode 100644 index 000000000..82875de27 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/invalid_variables_inside_list_value.graphql @@ -0,0 +1,6 @@ +query ($p1: ProfileDetail, $p2: ProfileDetail!) { + searchProfile(profileDetail: [$p1, $p2]) { + age + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input.graphql new file mode 100644 index 000000000..ddb68eaab --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input.graphql @@ -0,0 +1,3 @@ +query { + concat(words: ["Hello!", "This", "is", "Ballerina", "GraphQL"]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_empty_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_empty_value.graphql new file mode 100644 index 000000000..25e96d445 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_empty_value.graphql @@ -0,0 +1,3 @@ +query { + concat(words: []) +} diff --git a/ballerina-tests/tests/resources/documents/list_type_input_with_invalid_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_invalid_variables.graphql similarity index 52% rename from ballerina-tests/tests/resources/documents/list_type_input_with_invalid_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_invalid_variables.graphql index 8d05b6828..4895d1709 100644 --- a/ballerina-tests/tests/resources/documents/list_type_input_with_invalid_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_invalid_variables.graphql @@ -1,3 +1,3 @@ query ($words: [String]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_null_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_null_value.graphql new file mode 100644 index 000000000..2e8a3a16a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_null_value.graphql @@ -0,0 +1,3 @@ +query { + concat(words: ["Hello!", "This", "is", "a", "Null", "Value", "->", null]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_variable.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_variable.graphql new file mode 100644 index 000000000..0fc13d3c0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_input_with_variable.graphql @@ -0,0 +1,3 @@ +query ($words: [String!]) { + concat(words: $words) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_inputs_with_nested_list.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_inputs_with_nested_list.graphql new file mode 100644 index 000000000..ddb7ce45c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_inputs_with_nested_list.graphql @@ -0,0 +1,3 @@ +query { + getTotal(prices: [[2, 3, 4], [4, 5, 6, 7], [3, 5, 6, 4, 2, 7]]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_inside_list_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_inside_list_value.graphql new file mode 100644 index 000000000..060394791 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_inside_list_value.graphql @@ -0,0 +1,3 @@ +query ($list1: [Float!]!) { + getTotal(prices: [[2, 3, 4], $list1, [3, 5, 6, 4, 2, 7]]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_input_objects.graphql new file mode 100644 index 000000000..2a245c83a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_input_objects.graphql @@ -0,0 +1,5 @@ +query ($tvSeries: [TvSeries!]!) { + getSuggestions(tvSeries: $tvSeries) { + movieName + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql new file mode 100644 index 000000000..2a245c83a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql @@ -0,0 +1,5 @@ +query ($tvSeries: [TvSeries!]!) { + getSuggestions(tvSeries: $tvSeries) { + movieName + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql new file mode 100644 index 000000000..2a245c83a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql @@ -0,0 +1,5 @@ +query ($tvSeries: [TvSeries!]!) { + getSuggestions(tvSeries: $tvSeries) { + movieName + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql new file mode 100644 index 000000000..2a245c83a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql @@ -0,0 +1,5 @@ +query ($tvSeries: [TvSeries!]!) { + getSuggestions(tvSeries: $tvSeries) { + movieName + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_default_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_default_value.graphql new file mode 100644 index 000000000..ab3a21642 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_default_value.graphql @@ -0,0 +1,3 @@ +query { + isIncludeHoliday +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_enum_values.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_enum_values.graphql new file mode 100644 index 000000000..b5da2ce2b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_enum_values.graphql @@ -0,0 +1,3 @@ +query { + isIncludeHoliday(days: [MONDAY, FRIDAY, TUESDAY, SATURDAY]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_input_objects.graphql new file mode 100644 index 000000000..d07a542b9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_input_objects.graphql @@ -0,0 +1,7 @@ +query { + getSuggestions( + tvSeries: [{ name: "Breaking Bad", episodes: [{ title: "ep1" }] }] + ) { + movieName + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_enum_values.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_enum_values.graphql new file mode 100644 index 000000000..1ad3cc293 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_enum_values.graphql @@ -0,0 +1,3 @@ +query { + isIncludeHoliday(days: [MONDAY, FRIDAY, TUESDAY, SATURDAY, WEdnesday, 4]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql new file mode 100644 index 000000000..9a9dbff85 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql @@ -0,0 +1,10 @@ +query { + getSuggestions( + tvSeries: [ + { name: "Breaking Bad", episodes: [{ title: "ep1" }] } + { name: "Breaking Bad", episodes: true } + ] + ) { + movieName + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql new file mode 100644 index 000000000..66c741a0e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql @@ -0,0 +1,15 @@ +query { + getSuggestions( + tvSeries: [ + { + name: "GOT" + episodes: [ + { title: "ep1", newCharacters: ["Sherlock", "Jessie"] } + { title: "ep2", newCharacters: [true, 4] } + ] + } + ] + ) { + movieName + } +} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql similarity index 73% rename from ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql index 3a01763b3..3cefa4361 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_1.graphql @@ -1,3 +1,3 @@ query ($words: [String] = ["Hello!", "This", "is", Ballerina, true]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql similarity index 74% rename from ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql index a93be7f8a..4e26614b0 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_2.graphql @@ -1,3 +1,3 @@ query ($words: [Int] = ["Hello!", "This", "is", "Ballerina", "GraphQL"]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql similarity index 65% rename from ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql index 6209417c1..edd954987 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_3.graphql @@ -1,3 +1,3 @@ query ($prices: [[Float!]!] = [[1, true, 3], false]) { - getTotal(prices: $prices) + getTotal(prices: $prices) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql new file mode 100644 index 000000000..049d8acf0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql @@ -0,0 +1,3 @@ +query ($prices: [[Float!]!] = [2, 3, 4, 5]) { + getTotal(prices: $prices) +} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql similarity index 67% rename from ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql index c97cae345..693423060 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_5.graphql @@ -1,3 +1,3 @@ query ($prices: [[Float!]!] = [[], [4, 5], [null], null]) { - getTotal(prices: $prices) + getTotal(prices: $prices) } diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql similarity index 57% rename from ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql index 5d1b04468..8dae237ea 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_6.graphql @@ -1,3 +1,3 @@ query ($prices: [[Float!]!] = null) { - getTotal(prices: $prices) + getTotal(prices: $prices) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql new file mode 100644 index 000000000..c7fcecdb0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql @@ -0,0 +1,6 @@ +query ($profileDetail: [ProfileDetail] = [null, [], { name: "Arthur" }]) { + searchProfile(profileDetail: $profileDetail) { + name + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql new file mode 100644 index 000000000..6ece9e69c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql @@ -0,0 +1,3 @@ +query ($days: [Weekday] = [MONDAY, FRIDAY, TUESDAY, SATURDAY]) { + isIncludeHoliday(days: $days) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql new file mode 100644 index 000000000..db1c1ec07 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql @@ -0,0 +1,3 @@ +query ($days: [Weekday!] = [MONDAY, FRIDAY, TUSDAY, SATURDAY]) { + isIncludeHoliday(days: $days) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql new file mode 100644 index 000000000..765fd2fa2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql @@ -0,0 +1,15 @@ +query { + getSuggestions( + tvSeries: [ + { + name: "GOT" + episodes: [ + { title: "ep1", newCharacters: ["Sherlock", "Jessie"] } + { title: "ep2", newCharacters: ["Michael", "Jessie"] } + ] + } + ] + ) { + movieName + } +} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_1.graphql similarity index 75% rename from ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_1.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_1.graphql index 4b3860112..1312a1c1a 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_1.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_1.graphql @@ -1,3 +1,3 @@ query ($words: [String] = ["Hello!", "This", "is", "Ballerina", "GraphQL"]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_2.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_2.graphql similarity index 56% rename from ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_2.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_2.graphql index 894d24200..339ca0fff 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_2.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_2.graphql @@ -1,3 +1,3 @@ query ($words: [String] = []) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_3.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_3.graphql similarity index 71% rename from ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_3.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_3.graphql index cfa9b649c..7660992b1 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_3.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_3.graphql @@ -1,3 +1,3 @@ query ($words: [String] = [null, null, "Hello", "GraphQL"]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_4.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_4.graphql similarity index 67% rename from ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_4.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_4.graphql index 3684d2a86..4bdc40e92 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_4.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_4.graphql @@ -1,3 +1,3 @@ query ($prices: [[Float!]!] = [[1, 2, 3], [34, 56, 65]]) { - getTotal(prices: $prices) + getTotal(prices: $prices) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_5.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_5.graphql new file mode 100644 index 000000000..096b09a6d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_5.graphql @@ -0,0 +1,11 @@ +query ( + $profileDetail: [ProfileDetail!] = [ + { name: "Jessie", age: 28 } + { name: "Arthur", age: 5 } + ] +) { + searchProfile(profileDetail: $profileDetail) { + name + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_6.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_6.graphql new file mode 100644 index 000000000..096b09a6d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_6.graphql @@ -0,0 +1,11 @@ +query ( + $profileDetail: [ProfileDetail!] = [ + { name: "Jessie", age: 28 } + { name: "Arthur", age: 5 } + ] +) { + searchProfile(profileDetail: $profileDetail) { + name + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_7.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_7.graphql new file mode 100644 index 000000000..bb29159b5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_7.graphql @@ -0,0 +1,16 @@ +query ( + $tvSeries: [TvSeries!]! = [ + { + name: "GOT" + episodes: [ + { title: "ep1", newCharacters: ["Sherlock", "Jessie"] } + { title: "ep2", newCharacters: ["Michael", "Jessie"] } + ] + } + ] +) { + getSuggestions(tvSeries: $tvSeries) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_8.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_8.graphql new file mode 100644 index 000000000..6386a5249 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_8.graphql @@ -0,0 +1,11 @@ +query ( + $tvSeries: TvSeries = { + name: "Breaking Bad" + episodes: [{ title: "Cancer Man", newCharacters: ["Sherlock"] }] + } +) { + getMovie(tvSeries: $tvSeries) { + movieName + director + } +} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_9.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_9.graphql similarity index 66% rename from ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_9.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_9.graphql index 1f1b4b45e..7d26d0105 100644 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_9.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_with_variable_default_values_9.graphql @@ -1,3 +1,3 @@ query ($days: [Weekday!] = [MONDAY, FRIDAY, TUESDAY, SATURDAY]) { - isIncludeHoliday(days: $days) + isIncludeHoliday(days: $days) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects.graphql new file mode 100644 index 000000000..f2b9fc8ff --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects.graphql @@ -0,0 +1,8 @@ +query { + getMovie( + tvSeries: { name: "Breaking Bad", episodes: [{ title: "Cancer Man" }] } + ) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects_with_variables.graphql new file mode 100644 index 000000000..654984afb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/list_type_within_input_objects_with_variables.graphql @@ -0,0 +1,6 @@ +query ($tvSeries: TvSeries!) { + getMovie(tvSeries: $tvSeries) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map.graphql new file mode 100644 index 000000000..b9bbbafe3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map.graphql @@ -0,0 +1,7 @@ +query { + company { + workers(key: "id1") { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_invalid_key.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_invalid_key.graphql new file mode 100644 index 000000000..85fadcb01 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_invalid_key.graphql @@ -0,0 +1,8 @@ +query { + languages { + backend: name(key: "backend") + desktop: name(key: "desktop") + frontend: name(key: "frontend") + deploy: name(key: "deployment") + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_valid_key.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_valid_key.graphql new file mode 100644 index 000000000..a23e52501 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_with_valid_key.graphql @@ -0,0 +1,5 @@ +query ($purpose: String!) { + languages { + backend: name(key: $purpose) + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_without_key_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_without_key_input.graphql new file mode 100644 index 000000000..ed1e469b1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/map_without_key_input.graphql @@ -0,0 +1,7 @@ +query { + company { + workers { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_directive_usage_in_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_directive_usage_in_fields.graphql new file mode 100644 index 000000000..5a8c1e586 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_directive_usage_in_fields.graphql @@ -0,0 +1,10 @@ +query getPerson { + detective @skip(if: false) @include(if: true) { + name @skip(if: true) @include(if: true) + age @include(if: false) @skip(if: true) + address { + city @include(if: false) @skip(if: false) + street + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations.graphql new file mode 100644 index 000000000..b8407b075 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations.graphql @@ -0,0 +1,14 @@ +mutation { + setName(name: "Heisenberg") { + name + address { + city + } + } + setCity(city: "New Hampshire") { + name + address { + city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations_on_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations_on_service_objects.graphql new file mode 100644 index 000000000..120b8965c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_mutations_on_service_objects.graphql @@ -0,0 +1,10 @@ +mutation { + setTeacherSubject(subject: "Chemistry") { + subject + name + } + setTeacherName(name: "Walter White") { + name + subject + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql new file mode 100644 index 000000000..ea291082f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql @@ -0,0 +1,11 @@ +query getDetective { + detective { + name + } +} + +query getAge { + teacher { + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_variable_types_with_single_query.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_variable_types_with_single_query.graphql new file mode 100644 index 000000000..29e6c5fff --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/multiple_variable_types_with_single_query.graphql @@ -0,0 +1,13 @@ +query ( + $name: String! + $age: Int! + $weight: Float! + $day: Weekday + $holiday: Boolean! +) { + greet(name: $name) + isLegal(age: $age) + weightInPounds(weightInKg: $weight) + isHoliday(weekday: $day) + getDay(isHoliday: $holiday) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation.graphql new file mode 100644 index 000000000..b9ef7e3f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation.graphql @@ -0,0 +1,5 @@ +mutation { + setName(name: "Heisenberg") { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql new file mode 100644 index 000000000..b9ef7e3f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql @@ -0,0 +1,5 @@ +mutation { + setName(name: "Heisenberg") { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_type_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_type_introspection.graphql new file mode 100644 index 000000000..d1e4d611a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/mutation_type_introspection.graphql @@ -0,0 +1,10 @@ +{ + __schema { + mutationType { + kind + fields { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/named_fragments_with_duplicate_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/named_fragments_with_duplicate_fields.graphql new file mode 100644 index 000000000..bbe9aff23 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/named_fragments_with_duplicate_fields.graphql @@ -0,0 +1,37 @@ +query { + ...data +} + +fragment data on Query { + people { + ...p1 + ...p2 + } + + students { + ...student + } +} + +fragment p1 on Person { + address { + city + } + address { + street + city + } +} + +fragment p2 on Person { + address { + city + } + address { + number + } +} + +fragment student on Student { + name +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments.graphql new file mode 100644 index 000000000..094b34932 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments.graphql @@ -0,0 +1,23 @@ +query { + ...data +} + +fragment data on Query { + people { + ...AddressFragment + } +} + +fragment AddressFragment on Person { + address { + ...CityFragment + } +} + +fragment CityFragment on Address { + ...CityFragmentDuplicate +} + +fragment CityFragmentDuplicate on Address { + city +} diff --git a/ballerina-tests/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql similarity index 55% rename from ballerina-tests/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql index 03095325a..243cc132f 100644 --- a/ballerina-tests/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_fragments_querying_service_objects_with_multiple_fields.graphql @@ -1,18 +1,18 @@ query { - ... QueryFragment + ...QueryFragment } fragment QueryFragment on Query { - teacher { - ...TeacherFragment - } + teacher { + ...TeacherFragment + } } fragment TeacherFragment on TeacherService { - ...NameFragment + ...NameFragment } fragment NameFragment on TeacherService { - name, - subject + name + subject } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql new file mode 100644 index 000000000..1c1a4c7af --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql @@ -0,0 +1,3 @@ +query { + getTotal(prices: [[2, 3, d], [4, 5, 6, "is"], [3, 5, 6, 4, true, 7]]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql new file mode 100644 index 000000000..3d4094dc2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql @@ -0,0 +1,3 @@ +query { + getTotal(prices: [2, 3, 4, 5, 6]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map.graphql new file mode 100644 index 000000000..17b2a80d8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map.graphql @@ -0,0 +1,9 @@ +query { + company { + workers(key: "id3") { + contacts(key: "home") { + number + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map_without_key_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map_without_key_input.graphql new file mode 100644 index 000000000..c78d66c95 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_map_without_key_input.graphql @@ -0,0 +1,7 @@ +query { + company { + workers(key: "w1") { + contacts + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_records_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_records_array.graphql new file mode 100644 index 000000000..9c7850c00 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nested_records_array.graphql @@ -0,0 +1,11 @@ +{ + students { + name + courses { + name + books { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_list.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_list.graphql new file mode 100644 index 000000000..2c023374a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_list.graphql @@ -0,0 +1,8 @@ +{ + cities( + addresses: [ + { number: "308", street: "Negra Arroyo Lane", city: "Albequerque" } + { number: "Unknown", street: "Unknown", city: "Hogwarts" } + ] + ) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record.graphql new file mode 100644 index 000000000..99d89ee37 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record.graphql @@ -0,0 +1,5 @@ +{ + city( + address: { number: "308", street: "Negra Arroyo Lane", city: "Albequerque" } + ) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record_field.graphql new file mode 100644 index 000000000..bf13dfdad --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_input_for_nullable_record_field.graphql @@ -0,0 +1,3 @@ +{ + accountNumber(account: { number: 123456, contact: { number: "07123456789" } }) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql new file mode 100644 index 000000000..231144460 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql @@ -0,0 +1,6 @@ +query ($tvSeries: [TvSeries!]!) { + getSuggestions(tvSeries: $tvSeries) { + movieName + director + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql new file mode 100644 index 000000000..bdc732eec --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql @@ -0,0 +1,6 @@ +{ + getSuggestions(tvSeries: []) { + movieName + director + } +} diff --git a/ballerina-tests/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql similarity index 95% rename from ballerina-tests/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql index cfb0a6f8d..e69862c2a 100644 --- a/ballerina-tests/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/non_null_type_variables_with_nullable_rgument.graphql @@ -1,3 +1,3 @@ ($day:Weekday!) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input.graphql new file mode 100644 index 000000000..67dbd018b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input.graphql @@ -0,0 +1,3 @@ +{ + isHoliday(weekday: null) +} diff --git a/ballerina-tests/tests/resources/documents/null_as_enum_input_with_variable_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input_with_variable_value.graphql similarity index 95% rename from ballerina-tests/tests/resources/documents/null_as_enum_input_with_variable_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input_with_variable_value.graphql index 3234203ff..2350619eb 100644 --- a/ballerina-tests/tests/resources/documents/null_as_enum_input_with_variable_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_enum_input_with_variable_value.graphql @@ -1,3 +1,3 @@ ($day:Weekday) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_resource_function_name.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_resource_function_name.graphql new file mode 100644 index 000000000..ac861ff4a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_resource_function_name.graphql @@ -0,0 +1,3 @@ +{ + null(value: null) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input.graphql new file mode 100644 index 000000000..23e986acf --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input.graphql @@ -0,0 +1,5 @@ +{ + profile(id: null) { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql index 355dad60b..e8faffaf8 100644 --- a/ballerina-tests/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_as_scalar_input_with_variable_value.graphql @@ -2,4 +2,4 @@ profile(id: $id) { name } -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_input_for_nullable_record_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_input_for_nullable_record_field.graphql new file mode 100644 index 000000000..61b82fcf3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_input_for_nullable_record_field.graphql @@ -0,0 +1,3 @@ +{ + accountNumber(account: { number: 123456, contact: null }) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments.graphql new file mode 100644 index 000000000..ab40245de --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments.graphql @@ -0,0 +1,5 @@ +mutation { + profile(name: null) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql new file mode 100644 index 000000000..498b80a29 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql @@ -0,0 +1,5 @@ +mutation ($name: String) { + profile(name: $name) { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument.graphql new file mode 100644 index 000000000..f1f345340 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument.graphql @@ -0,0 +1,3 @@ +{ + greet(name: null) +} diff --git a/ballerina-tests/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql similarity index 95% rename from ballerina-tests/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql index 9dd7f930a..85e99536c 100644 --- a/ballerina-tests/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_non_null_argument_with_variable_value.graphql @@ -1,3 +1,3 @@ ($name: String!) { greet(name: $name) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql new file mode 100644 index 000000000..5754ab7a4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql @@ -0,0 +1,3 @@ +{ + name(id: null) +} diff --git a/ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql index 0487a4e14..ee4f44611 100644 --- a/ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_input_object_with_variable_value.graphql @@ -2,4 +2,4 @@ book(author: $author) { name } -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql similarity index 52% rename from ballerina-tests/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql index 8d05b6828..4895d1709 100644 --- a/ballerina-tests/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_for_nullable_list_type_input_with_variables.graphql @@ -1,3 +1,3 @@ query ($words: [String]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field.graphql new file mode 100644 index 000000000..5f33c623e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field.graphql @@ -0,0 +1,5 @@ +{ + book(author: { name: null, id: 1 }) { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql similarity index 97% rename from ballerina-tests/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql index 0487a4e14..ee4f44611 100644 --- a/ballerina-tests/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_input_object_field_with_variable_value.graphql @@ -2,4 +2,4 @@ book(author: $author) { name } -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql similarity index 52% rename from ballerina-tests/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql index 8d05b6828..4895d1709 100644 --- a/ballerina-tests/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/null_value_in_list_type_input_with_variables.graphql @@ -1,3 +1,3 @@ query ($words: [String]) { - concat(words: $words) + concat(words: $words) } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_list.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_list.graphql new file mode 100644 index 000000000..dbca8ba4f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_list.graphql @@ -0,0 +1,3 @@ +{ + cities(addresses: null) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_record.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_record.graphql new file mode 100644 index 000000000..9b2f472b1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_input_for_nullable_record.graphql @@ -0,0 +1,3 @@ +{ + city(address: null) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql new file mode 100644 index 000000000..b1165f28f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql @@ -0,0 +1,3 @@ +query { + concat(words: ["Hello!", 5, true, {}, "GraphQL"]) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_without_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_without_value.graphql new file mode 100644 index 000000000..87fd10add --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_list_type_input_without_value.graphql @@ -0,0 +1,3 @@ +query { + concat +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql new file mode 100644 index 000000000..ccb17d1b2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql @@ -0,0 +1,7 @@ +query { + services { + ... on TeacherService { + name + } + } +} diff --git a/ballerina-tests/tests/resources/documents/nullable_variables_without_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_variables_without_value.graphql similarity index 95% rename from ballerina-tests/tests/resources/documents/nullable_variables_without_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_variables_without_value.graphql index 3234203ff..2350619eb 100644 --- a/ballerina-tests/tests/resources/documents/nullable_variables_without_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/nullable_variables_without_value.graphql @@ -1,3 +1,3 @@ ($day:Weekday) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_arrays_with_invalid_query.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_arrays_with_invalid_query.graphql new file mode 100644 index 000000000..611d0a758 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_arrays_with_invalid_query.graphql @@ -0,0 +1,3 @@ +{ + searchVehicles(keyword: "vehicle") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_with_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_with_value.graphql new file mode 100644 index 000000000..cda899f0c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_with_value.graphql @@ -0,0 +1,3 @@ +{ + isHoliday(weekday: SUNDAY) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_without_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_without_value.graphql new file mode 100644 index 000000000..f2c8078e4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/optional_enum_argument_without_value.graphql @@ -0,0 +1,3 @@ +{ + isHoliday +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_type_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_type_introspection.graphql new file mode 100644 index 000000000..137152e4d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_type_introspection.graphql @@ -0,0 +1,10 @@ +{ + __schema { + queryType { + kind + fields { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_with_default_parameter.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_with_default_parameter.graphql new file mode 100644 index 000000000..ceeb794c7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_with_default_parameter.graphql @@ -0,0 +1,3 @@ +{ + quoteById(id: 2) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_without_default_parameter.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_without_default_parameter.graphql new file mode 100644 index 000000000..d0cc94bb4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/query_without_default_parameter.graphql @@ -0,0 +1,3 @@ +{ + quoteById +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_subfields_on_type_name.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_subfields_on_type_name.graphql new file mode 100644 index 000000000..5107036f1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_subfields_on_type_name.graphql @@ -0,0 +1,7 @@ +{ + detective { + __typename { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_table_without_selections.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_table_without_selections.graphql new file mode 100644 index 000000000..f26bcf2ad --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/querying_table_without_selections.graphql @@ -0,0 +1,3 @@ +{ + employees +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/record_type_arrays.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/record_type_arrays.graphql new file mode 100644 index 000000000..74a7f3569 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/record_type_arrays.graphql @@ -0,0 +1,8 @@ +{ + people { + name + address { + city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field.graphql new file mode 100644 index 000000000..5c4c176ac --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field.graphql @@ -0,0 +1,5 @@ +{ + profile(id: 4) { + status + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field_from_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field_from_service_objects.graphql new file mode 100644 index 000000000..d1167a621 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/request_invalid_field_from_service_objects.graphql @@ -0,0 +1,11 @@ +query { + allLifts(status: OPEN) { + name + id + invalid + trailAccess { + name + difficulty + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/requesting_object_without_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/requesting_object_without_fields.graphql new file mode 100644 index 000000000..ed62f0529 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/requesting_object_without_fields.graphql @@ -0,0 +1,3 @@ +{ + profile(id: 4) +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql new file mode 100644 index 000000000..641d52ced --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql @@ -0,0 +1,8 @@ +{ + top3 { + product { + id + } + score + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_map_of_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_map_of_service_objects.graphql new file mode 100644 index 000000000..67ee88b38 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_map_of_service_objects.graphql @@ -0,0 +1,7 @@ +query { + account { + details(key: "acc1") { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql new file mode 100644 index 000000000..c084b77a7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql @@ -0,0 +1,8 @@ +{ + all { + product { + id + } + score + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables.graphql new file mode 100644 index 000000000..1f6e7d3a5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables.graphql @@ -0,0 +1,5 @@ +{ + all { + isoCode + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables_with_errors.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables_with_errors.graphql new file mode 100644 index 000000000..08030d6d8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resolver_returning_tables_with_errors.graphql @@ -0,0 +1,5 @@ +query { + tasks { + subTasks + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_arrays_missing_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_arrays_missing_fields.graphql new file mode 100644 index 000000000..ce5016efd --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_arrays_missing_fields.graphql @@ -0,0 +1,3 @@ +{ + people +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql new file mode 100644 index 000000000..51e29c1bc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql @@ -0,0 +1,7 @@ +{ + searchVehicles(keyword: "vehicle") { + ... on Vehicle { + id + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object.graphql new file mode 100644 index 000000000..38f35a449 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object.graphql @@ -0,0 +1,5 @@ +{ + greet { + generalGreeting + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object_array.graphql new file mode 100644 index 000000000..c92931f90 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_service_object_array.graphql @@ -0,0 +1,5 @@ +{ + allVehicles { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_tables.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_tables.graphql new file mode 100644 index 000000000..ab3e91bd1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/resource_returning_tables.graphql @@ -0,0 +1,5 @@ +{ + employees { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array.graphql new file mode 100644 index 000000000..895d1867f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array.graphql @@ -0,0 +1,3 @@ +query { + holidays +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array_with_errors.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array_with_errors.graphql new file mode 100644 index 000000000..8e2f30516 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_enum_array_with_errors.graphql @@ -0,0 +1,3 @@ +query { + openingDays +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql new file mode 100644 index 000000000..ef34ab112 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql @@ -0,0 +1,3 @@ +query { + specialHolidays +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_recursive_service_type.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_recursive_service_type.graphql new file mode 100644 index 000000000..f245e4ef3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_recursive_service_type.graphql @@ -0,0 +1,5 @@ +query { + trail(id: "blue-bird") { + name + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_union_of_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_union_of_service_objects.graphql new file mode 100644 index 000000000..d5a5719d5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/returning_union_of_service_objects.graphql @@ -0,0 +1,14 @@ +query { + search(status: OPEN) { + ...TrailFragment + ...LiftFragment + } +} + +fragment TrailFragment on Trail { + name +} + +fragment LiftFragment on Lift { + name +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias.graphql new file mode 100644 index 000000000..6a9f6787c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias.graphql @@ -0,0 +1,14 @@ +{ + sherlock: profile(id: 0) { + name + residence: address { + hometown: city + } + } + walter: profile(id: 1) { + name + residence: address { + hometown: city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql new file mode 100644 index 000000000..3e13ea3aa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql @@ -0,0 +1,14 @@ +{ + sherlock: profile(id: 0) { + name + residence: address { + apartment: number + } + } + walter: profile(id: 1) { + name + residence: address { + hometown: city + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays.graphql new file mode 100644 index 000000000..ad0e0c220 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays.graphql @@ -0,0 +1,3 @@ +{ + ids +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays_with_errors.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays_with_errors.graphql new file mode 100644 index 000000000..11f152d28 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_arrays_with_errors.graphql @@ -0,0 +1,3 @@ +{ + idsWithErrors +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql new file mode 100644 index 000000000..ddcc86579 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql @@ -0,0 +1,3 @@ +{ + friends +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql new file mode 100644 index 000000000..c0ab8a3a1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql @@ -0,0 +1,10 @@ +{ + allVehicles { + ...Details + } +} + +fragment Details on Vehicle { + name + registeredYear +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_invalid_response_order.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_invalid_response_order.graphql new file mode 100644 index 000000000..c0ab8a3a1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_array_with_invalid_response_order.graphql @@ -0,0 +1,10 @@ +{ + allVehicles { + ...Details + } +} + +fragment Details on Vehicle { + name + registeredYear +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_defined_as_record_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_defined_as_record_field.graphql new file mode 100644 index 000000000..324a34975 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_object_defined_as_record_field.graphql @@ -0,0 +1,8 @@ +{ + latest { + product { + id + } + score + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_with_other_annotations.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_with_other_annotations.graphql new file mode 100644 index 000000000..06f514d7d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/service_with_other_annotations.graphql @@ -0,0 +1,3 @@ +query { + greeting +} diff --git a/ballerina-tests/tests/resources/documents/test_quering_on_interface.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_quering_on_interface.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/test_quering_on_interface.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_quering_on_interface.graphql diff --git a/ballerina-tests/tests/resources/documents/test_querying_fragment_on_transitive_interface.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_querying_fragment_on_transitive_interface.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/test_querying_fragment_on_transitive_interface.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_querying_fragment_on_transitive_interface.graphql diff --git a/ballerina-tests/tests/resources/documents/test_querying_on_transitive_type.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_querying_on_transitive_type.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/test_querying_on_transitive_type.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_querying_on_transitive_type.graphql diff --git a/ballerina-tests/tests/resources/documents/test_querying_on_transitive_type_and_interface.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_querying_on_transitive_type_and_interface.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/test_querying_on_transitive_type_and_interface.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/test_querying_on_transitive_type_and_interface.graphql diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection.graphql new file mode 100644 index 000000000..745ffe300 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection.graphql @@ -0,0 +1,8 @@ +{ + __type(name: "Person") { + kind + fields { + name + } + } +} diff --git a/ballerina-tests/tests/resources/documents/typename_introspection_on_type_record.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_in_invalid_place.graphql similarity index 53% rename from ballerina-tests/tests/resources/documents/typename_introspection_on_type_record.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_in_invalid_place.graphql index d1265943b..2512c56c8 100644 --- a/ballerina-tests/tests/resources/documents/typename_introspection_on_type_record.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_in_invalid_place.graphql @@ -1,5 +1,7 @@ { + profile(id: 1) { __type(name: "Person") { - __typename + kind } + } } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_on_non_existing_type.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_on_non_existing_type.graphql new file mode 100644 index 000000000..6313aeeda --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_on_non_existing_type.graphql @@ -0,0 +1,5 @@ +{ + __type(name: "INVALID") { + kind + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_with_alias.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_with_alias.graphql new file mode 100644 index 000000000..538d36007 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_with_alias.graphql @@ -0,0 +1,6 @@ +{ + FieldType: __type(name: "__Field") { + name + kind + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_fields.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_fields.graphql new file mode 100644 index 000000000..a4e53f003 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_fields.graphql @@ -0,0 +1,3 @@ +{ + __type(name: "Person") +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_type_name_argument.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_type_name_argument.graphql new file mode 100644 index 000000000..8416c855d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_introspection_without_type_name_argument.graphql @@ -0,0 +1,8 @@ +{ + __type { + kind + fields { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_in_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_in_fragments.graphql new file mode 100644 index 000000000..35d101c30 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_in_fragments.graphql @@ -0,0 +1,15 @@ +{ + search { + ...StudentFragment + ...TeacherFragment + } +} + +fragment StudentFragment on StudentService { + __typename + name +} + +fragment TeacherFragment on TeacherService { + subject +} diff --git a/ballerina-tests/tests/resources/documents/type_name_introspection_in_fragments.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql similarity index 55% rename from ballerina-tests/tests/resources/documents/type_name_introspection_in_fragments.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql index 6557510e4..c1867cf9f 100644 --- a/ballerina-tests/tests/resources/documents/type_name_introspection_in_fragments.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql @@ -1,15 +1,15 @@ { - search { - ...StudentFragment - ...TeacherFragment - } + services { + __typename + ...StudentFragment + ...TeacherFragment + } } fragment StudentFragment on StudentService { - __typename - name + name } fragment TeacherFragment on TeacherService { - subject + subject } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_operation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_operation.graphql new file mode 100644 index 000000000..6a295f0d8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_operation.graphql @@ -0,0 +1,3 @@ +{ + __typename +} diff --git a/ballerina-tests/tests/resources/documents/type_name_introspection_on_operation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_record_types.graphql similarity index 51% rename from ballerina-tests/tests/resources/documents/type_name_introspection_on_operation.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_record_types.graphql index a1d4e6a20..4ee9e486c 100644 --- a/ballerina-tests/tests/resources/documents/type_name_introspection_on_operation.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_record_types.graphql @@ -1,3 +1,5 @@ { + detective { __typename + } } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_service_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_service_types.graphql new file mode 100644 index 000000000..1c2d3b062 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_service_types.graphql @@ -0,0 +1,6 @@ +{ + teacher { + name + __typename + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql new file mode 100644 index 000000000..4e660cf12 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql @@ -0,0 +1,15 @@ +{ + search { + __typename + ...StudentFragment + ...TeacherFragment + } +} + +fragment StudentFragment on StudentService { + name +} + +fragment TeacherFragment on TeacherService { + subject +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_field.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_field.graphql new file mode 100644 index 000000000..1e35eba7c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_field.graphql @@ -0,0 +1,9 @@ +{ + __type(name: "Person") { + name + fields { + name + __typename + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_scalar.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_scalar.graphql new file mode 100644 index 000000000..34916e69e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_scalar.graphql @@ -0,0 +1,7 @@ +{ + detective { + name { + __typename + } + } +} diff --git a/ballerina-tests/tests/resources/documents/typename_introspection_on_schema_introspection.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_schema_introspection.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/typename_introspection_on_schema_introspection.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_schema_introspection.graphql diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_type_record.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_type_record.graphql new file mode 100644 index 000000000..6501c0405 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/typename_introspection_on_type_record.graphql @@ -0,0 +1,5 @@ +{ + __type(name: "Person") { + __typename + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_service_objects.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_service_objects.graphql new file mode 100644 index 000000000..9ccf16a85 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_service_objects.graphql @@ -0,0 +1,11 @@ +query { + profile(id: 200) { + ... on StudentService { + name + } + ... on TeacherService { + name + subject + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql new file mode 100644 index 000000000..d1803f2b8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql @@ -0,0 +1,7 @@ +query { + search { + ... on TeacherService { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql new file mode 100644 index 000000000..3b86d91f0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql @@ -0,0 +1,9 @@ +query { + ... on Query { + search { + ... on TeacherService { + name + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql new file mode 100644 index 000000000..1d871943a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql @@ -0,0 +1,7 @@ +query { + profile(id: 200) { + ... on StudentService { + name + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_type_names.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_type_names.graphql new file mode 100644 index 000000000..687990177 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_type_names.graphql @@ -0,0 +1,25 @@ +{ + __schema { + queryType { + fields { + name + type { + name + kind + ofType { + name + kind + ofType { + name + kind + ofType { + name + kind + } + } + } + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_field_returning_enum.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_field_returning_enum.graphql new file mode 100644 index 000000000..076c3913d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_field_returning_enum.graphql @@ -0,0 +1,8 @@ +query { + profile(id: 101) { + ... on TeacherService { + name + holidays + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql new file mode 100644 index 000000000..ebeadbcee --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql @@ -0,0 +1,11 @@ +query { + profile(id: 101) { + ... on TeacherService { + holidays + school { + name + openingDays + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/unknown_inline_fragment.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/unknown_inline_fragment.graphql new file mode 100644 index 000000000..54748e232 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/unknown_inline_fragment.graphql @@ -0,0 +1,5 @@ +query { + ... on on { + name + } +} diff --git a/ballerina-tests/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql index 57582fda0..a2ea3e332 100644 --- a/ballerina-tests/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variable_default_value_with_coerce_int_input_to_float.graphql @@ -1,3 +1,3 @@ ($weight:Float = 4) { weightInPounds(weightInKg: $weight) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_inside_list_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_inside_list_value.graphql new file mode 100644 index 000000000..934a0ad50 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_inside_list_value.graphql @@ -0,0 +1,15 @@ +query ($name1: String = "Michael", $name2: String!) { + getSuggestions( + tvSeries: [ + { + name: $name1 + episodes: [ + { title: "ep1", newCharacters: ["Sherlock", $name1] } + { title: "ep2", newCharacters: [$name1, $name2] } + ] + } + ] + ) { + movieName + } +} diff --git a/ballerina-tests/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql index cbb164c54..3d931537f 100644 --- a/ballerina-tests/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_coerce_int_input_to_float.graphql @@ -1,3 +1,3 @@ ($weight:Float!) { weightInPounds(weightInKg:$weight) -} +} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/documents/variables_with_default_null_value.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_null_value.graphql similarity index 96% rename from ballerina-tests/tests/resources/documents/variables_with_default_null_value.graphql rename to ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_null_value.graphql index 59eef4532..86007b55c 100644 --- a/ballerina-tests/tests/resources/documents/variables_with_default_null_value.graphql +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_null_value.graphql @@ -1,3 +1,3 @@ ($day:Weekday = null) { isHoliday(weekday: $day) -} +} \ No newline at end of file diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_values.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_values.graphql new file mode 100644 index 000000000..84fd4b148 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_default_values.graphql @@ -0,0 +1,15 @@ +query getData($profileId: Int = 1) { + ...data +} + +fragment data on Query { + profile(id: $profileId) { + ...people + } +} + +fragment people on Person { + address { + city + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_multiple_operations.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_multiple_operations.graphql new file mode 100644 index 000000000..7e0081852 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_multiple_operations.graphql @@ -0,0 +1,13 @@ +query GetProfile($id: Int!) { + profile(id: $id) { + name + age + } +} + +query GetBook($author: Author!) { + profile(author: $author) { + name + age + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_nested_map.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_nested_map.graphql new file mode 100644 index 000000000..e7c22b6a8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_nested_map.graphql @@ -0,0 +1,9 @@ +query ($workerKey: String, $contractKey: String) { + company { + workers(key: $workerKey) { + contacts(key: $contractKey) { + number + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_query_and_mutation.graphql b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_query_and_mutation.graphql new file mode 100644 index 000000000..35a922c31 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/documents/variables_with_query_and_mutation.graphql @@ -0,0 +1,10 @@ +query Greeting($name: String!) { + greeting(name: $name) +} + +mutation Shape($name: String!, $edges: Int!) { + addShape(name: $name, edges: $edges) { + name + edges + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias.json new file mode 100644 index 000000000..30244b691 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias.json @@ -0,0 +1,12 @@ +{ + "data": { + "sherlock": { + "name": { + "first": "Sherlock" + }, + "address": { + "city": "London" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_error_path.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_error_path.json new file mode 100644 index 000000000..ce7297ac0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_error_path.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "No surname found", + "locations": [{ "line": 4, "column": 7 }], + "path": ["user", "name_fields", "username"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_hierarchical_resources.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_hierarchical_resources.json new file mode 100644 index 000000000..fb47ce864 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_hierarchical_resources.json @@ -0,0 +1,9 @@ +{ + "data": { + "sherlock": { + "address": { + "hometown": "London" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_service_objects_union.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_service_objects_union.json new file mode 100644 index 000000000..8ac0a0f10 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_on_service_objects_union.json @@ -0,0 +1,10 @@ +{ + "data": { + "jesse": { + "characterName": "Jesse Pinkman" + }, + "walt": { + "ssn": 737 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_with_invalid_field_name.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_with_invalid_field_name.json new file mode 100644 index 000000000..0ee84e1ce --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/alias_with_invalid_field_name.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"firstName\" on type \"Person\".", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/arrays_with_errors_in_record_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/arrays_with_errors_in_record_field.json new file mode 100644 index 000000000..3a0415595 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/arrays_with_errors_in_record_field.json @@ -0,0 +1,17 @@ +{ + "errors": [ + { + "message": "Undefined task!", + "locations": [{ "line": 5, "column": 7 }], + "path": ["project", "tasks", "subTasks", 1] + } + ], + "data": { + "project": { + "name": "Ballerina", + "tasks": { + "subTasks": null + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json new file mode 100644 index 000000000..1dc6e571e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json @@ -0,0 +1,7 @@ +{ + "data": { + "setName": { + "name": "Heisenberg" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json new file mode 100644 index 000000000..7d3c9f225 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json @@ -0,0 +1,7 @@ +{ + "data": { + "person": { + "age": 50 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json new file mode 100644 index 000000000..7d3c9f225 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json @@ -0,0 +1,7 @@ +{ + "data": { + "person": { + "age": 50 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json new file mode 100644 index 000000000..1dc6e571e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json @@ -0,0 +1,7 @@ +{ + "data": { + "setName": { + "name": "Heisenberg" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/ballerina_record_as_graphql_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/ballerina_record_as_graphql_object.json new file mode 100644 index 000000000..efe4d5ee3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/ballerina_record_as_graphql_object.json @@ -0,0 +1,10 @@ +{ + "data": { + "detective": { + "name": "Sherlock Holmes", + "address": { + "street": "Baker Street" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings.json new file mode 100644 index 000000000..6f849e2f8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings.json @@ -0,0 +1,5 @@ +{ + "data": { + "sendEmail": "Hello,\n World!,\n\nYours,\n GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_double_quotes.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_double_quotes.json new file mode 100644 index 000000000..2e09c2ff3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_double_quotes.json @@ -0,0 +1,5 @@ +{ + "data": { + "sendEmail": "Hello,\n \"\"World\"\"!,\n\nYours,\n GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_escaped_character.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_escaped_character.json new file mode 100644 index 000000000..dd16baa56 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_escaped_character.json @@ -0,0 +1,5 @@ +{ + "data": { + "sendEmail": "Hello,\n World!,\n\"\"\"\n Yours,\nGraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_variable_default_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_variable_default_value.json new file mode 100644 index 000000000..9e4b5e081 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/block_strings_with_variable_default_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "sendEmail": "Hello,\n GraphQL!," + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_decimal_to_float.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_decimal_to_float.json new file mode 100644 index 000000000..d4d47da99 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_decimal_to_float.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 124.362 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_input_to_float.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_input_to_float.json new file mode 100644 index 000000000..34497a06d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_input_to_float.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 2.205 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal.json new file mode 100644 index 000000000..d1398ce83 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal.json @@ -0,0 +1,5 @@ +{ + "data": { + "convertDecimalToFloat": 1.0 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json new file mode 100644 index 000000000..0d56caa98 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "convertDecimalToFloat": 5.0 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json new file mode 100644 index 000000000..fc6ccbd89 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/coerce_int_to_decimal_with_variable_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "convertDecimalToFloat": 2.0 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query.json new file mode 100644 index 000000000..b033de13d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query.json @@ -0,0 +1,25 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "__Field", "kind": "OBJECT" }, + { "name": "__TypeKind", "kind": "ENUM" }, + { "name": "TeacherService", "kind": "OBJECT" }, + { "name": "Query", "kind": "OBJECT" }, + { "name": "__Schema", "kind": "OBJECT" }, + { "name": "__Type", "kind": "OBJECT" }, + { "name": "__EnumValue", "kind": "OBJECT" }, + { "name": "__DirectiveLocation", "kind": "ENUM" }, + { "name": "StudentService", "kind": "OBJECT" }, + { "name": "String", "kind": "SCALAR" }, + { "name": "Int", "kind": "SCALAR" }, + { "name": "Vehicle", "kind": "OBJECT" }, + { "name": "Weekday", "kind": "ENUM" }, + { "name": "School", "kind": "OBJECT" }, + { "name": "__InputValue", "kind": "OBJECT" }, + { "name": "Boolean", "kind": "SCALAR" }, + { "name": "__Directive", "kind": "OBJECT" } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query_with_other_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query_with_other_fields.json new file mode 100644 index 000000000..0d34eb991 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_introspection_query_with_other_fields.json @@ -0,0 +1,26 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "__Field", "kind": "OBJECT" }, + { "name": "__TypeKind", "kind": "ENUM" }, + { "name": "TeacherService", "kind": "OBJECT" }, + { "name": "Query", "kind": "OBJECT" }, + { "name": "__Schema", "kind": "OBJECT" }, + { "name": "__Type", "kind": "OBJECT" }, + { "name": "__EnumValue", "kind": "OBJECT" }, + { "name": "__DirectiveLocation", "kind": "ENUM" }, + { "name": "StudentService", "kind": "OBJECT" }, + { "name": "String", "kind": "SCALAR" }, + { "name": "Int", "kind": "SCALAR" }, + { "name": "Vehicle", "kind": "OBJECT" }, + { "name": "Weekday", "kind": "ENUM" }, + { "name": "School", "kind": "OBJECT" }, + { "name": "__InputValue", "kind": "OBJECT" }, + { "name": "Boolean", "kind": "SCALAR" }, + { "name": "__Directive", "kind": "OBJECT" } + ] + }, + "allVehicles": [{ "name": "Benz" }, { "name": "BMW" }, { "name": "Ford" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_service.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_service.json new file mode 100644 index 000000000..a8aa43bd9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/complex_service.json @@ -0,0 +1,10 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock", + "last": "Holmes" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_input.json new file mode 100644 index 000000000..b16f787b2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "convertDecimalToFloat": 1.33 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_input.json new file mode 100644 index 000000000..c4a6e1a0d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "getTotalInDecimal": [6.13, 11.6, 20.0] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_default_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_default_input.json new file mode 100644 index 000000000..b611f657d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_default_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "getTotalInDecimal": [6.1886662, 11.63535, 20.0] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_variable_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_variable_input.json new file mode 100644 index 000000000..b611f657d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_list_with_variable_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "getTotalInDecimal": [6.1886662, 11.63535, 20.0] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_default_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_default_value.json new file mode 100644 index 000000000..ca2c1bafa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_default_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "getSubTotal": 218.5555332 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_variable.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_variable.json new file mode 100644 index 000000000..ca2c1bafa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_type_with_input_object_variable.json @@ -0,0 +1,5 @@ +{ + "data": { + "getSubTotal": 218.5555332 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_infinity.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_infinity.json new file mode 100644 index 000000000..22f8004fd --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_infinity.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Decimal cannot represent non Decimal value: -Infinity", + "locations": [{ "line": 2, "column": 32 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_zero.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_zero.json new file mode 100644 index 000000000..2662c8980 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_negative_zero.json @@ -0,0 +1,5 @@ +{ + "data": { + "convertDecimalToFloat": 0.0 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_positive_infinity.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_positive_infinity.json new file mode 100644 index 000000000..666d52d1d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/decimal_with_positive_infinity.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Decimal cannot represent non Decimal value: Infinity", + "locations": [{ "line": 2, "column": 32 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/default_values_in_input_object_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/default_values_in_input_object_fields.json new file mode 100644 index 000000000..827314718 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/default_values_in_input_object_fields.json @@ -0,0 +1,5 @@ +{ + "data": { + "name": "Sam" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering.json new file mode 100644 index 000000000..5450f69e3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering.json @@ -0,0 +1,121 @@ +{ + "data": { + "__schema": { + "queryType": { + "fields": [ + { + "name": "greeting", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "profile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [] + } + } + }, + { + "name": "school", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "School", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } + ] + }, + "mutationType": { + "fields": [ + { + "name": "addProfile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [] + } + } + }, + { + "name": "addInstrument", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "Instrument", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } + ] + }, + "subscriptionType": { + "fields": [ + { + "name": "instruments", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + } + ] + } + }, + "__type": { + "enumValues": [ + { + "name": "PERCUSSION", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "KEYBOARD", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "WOODWIND", + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "STRINGS", "isDeprecated": false, "deprecationReason": null } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json new file mode 100644 index 000000000..5450f69e3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json @@ -0,0 +1,121 @@ +{ + "data": { + "__schema": { + "queryType": { + "fields": [ + { + "name": "greeting", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "profile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [] + } + } + }, + { + "name": "school", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "School", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } + ] + }, + "mutationType": { + "fields": [ + { + "name": "addProfile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [] + } + } + }, + { + "name": "addInstrument", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "Instrument", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } + ] + }, + "subscriptionType": { + "fields": [ + { + "name": "instruments", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + } + ] + } + }, + "__type": { + "enumValues": [ + { + "name": "PERCUSSION", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "KEYBOARD", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "WOODWIND", + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "STRINGS", "isDeprecated": false, "deprecationReason": null } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection.json new file mode 100644 index 000000000..12b23261c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection.json @@ -0,0 +1,244 @@ +{ + "data": { + "__schema": { + "queryType": { + "fields": [ + { + "name": "hello", + "isDeprecated": true, + "deprecationReason": "Use the `greeting` field instead of this field.", + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "greeting", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "profile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [ + { + "name": "name", + "isDeprecated": true, + "deprecationReason": "Name field is deprecated" + }, + { + "name": "age", + "isDeprecated": true, + "deprecationReason": "Age field is deprecated" + }, + { + "name": "address", + "isDeprecated": true, + "deprecationReason": "Address field is deprecated" + } + ] + } + } + }, + { + "name": "school", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "School", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "openingDays", + "isDeprecated": true, + "deprecationReason": "School is now online." + } + ] + } + } + } + ] + }, + "mutationType": { + "fields": [ + { + "name": "addProfile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [ + { + "name": "name", + "isDeprecated": true, + "deprecationReason": "Name field is deprecated" + }, + { + "name": "age", + "isDeprecated": true, + "deprecationReason": "Age field is deprecated" + }, + { + "name": "address", + "isDeprecated": true, + "deprecationReason": "Address field is deprecated" + } + ] + } + } + }, + { + "name": "newInstrument", + "isDeprecated": true, + "deprecationReason": "Use the `addInstrument` field instead of this.", + "type": { + "ofType": { + "name": "Instrument", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + }, + { + "name": "addInstrument", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "Instrument", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } + ] + }, + "subscriptionType": { + "fields": [ + { + "name": "newInstruments", + "isDeprecated": true, + "deprecationReason": "Use the `instruments` field instead of this.", + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "instruments", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + } + ] + } + }, + "t1": { + "enumValues": [ + { + "name": "PERCUSSION", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BRASS", + "isDeprecated": true, + "deprecationReason": "Not used in this band" + }, + { + "name": "KEYBOARD", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "WOODWIND", + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "STRINGS", "isDeprecated": false, "deprecationReason": null } + ] + }, + "t2": { + "fields": [ + { + "name": "number", + "isDeprecated": true, + "deprecationReason": "Number field is deprecated", + "type": { + "ofType": { + "name": "Int", + "fields": null + } + } + }, + { + "name": "street", + "isDeprecated": true, + "deprecationReason": "Street field is deprecated", + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "city", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json new file mode 100644 index 000000000..a9c7e686a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json @@ -0,0 +1,207 @@ +{ + "data": { + "__schema": { + "queryType": { + "fields": [ + { + "name": "hello", + "isDeprecated": true, + "deprecationReason": "Use the `greeting` field instead of this field.", + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "greeting", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "profile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [ + { + "name": "name", + "isDeprecated": true, + "deprecationReason": "Name field is deprecated" + }, + { + "name": "age", + "isDeprecated": true, + "deprecationReason": "Age field is deprecated" + }, + { + "name": "address", + "isDeprecated": true, + "deprecationReason": "Address field is deprecated" + } + ] + } + } + }, + { + "name": "school", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "School", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "openingDays", + "isDeprecated": true, + "deprecationReason": "School is now online." + } + ] + } + } + } + ] + }, + "mutationType": { + "fields": [ + { + "name": "addProfile", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "DeprecatedProfile", + "fields": [ + { + "name": "name", + "isDeprecated": true, + "deprecationReason": "Name field is deprecated" + }, + { + "name": "age", + "isDeprecated": true, + "deprecationReason": "Age field is deprecated" + }, + { + "name": "address", + "isDeprecated": true, + "deprecationReason": "Address field is deprecated" + } + ] + } + } + }, + { + "name": "newInstrument", + "isDeprecated": true, + "deprecationReason": "Use the `addInstrument` field instead of this.", + "type": { + "ofType": { + "name": "Instrument", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + }, + { + "name": "addInstrument", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "Instrument", + "fields": [ + { + "name": "name", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } + ] + }, + "subscriptionType": { + "fields": [ + { + "name": "newInstruments", + "isDeprecated": true, + "deprecationReason": "Use the `instruments` field instead of this.", + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + }, + { + "name": "instruments", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "ofType": { + "name": "String", + "fields": null + } + } + } + ] + } + }, + "__type": { + "enumValues": [ + { + "name": "PERCUSSION", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BRASS", + "isDeprecated": true, + "deprecationReason": "Not used in this band" + }, + { + "name": "KEYBOARD", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "WOODWIND", + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "STRINGS", "isDeprecated": false, "deprecationReason": null } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directive_locations.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directive_locations.json new file mode 100644 index 000000000..3daede671 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directive_locations.json @@ -0,0 +1,11 @@ +{ + "data": { + "__schema": { + "directives": [ + { "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"] }, + { "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"] }, + { "locations": ["FIELD_DEFINITION", "ENUM_VALUE"] } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives.json new file mode 100644 index 000000000..cf5067e7c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives.json @@ -0,0 +1,9 @@ +{ + "data": { + "profile": { + "name": { + "last": "Holmes" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_skip_all_selections.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_skip_all_selections.json new file mode 100644 index 000000000..e69dd03e0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_skip_all_selections.json @@ -0,0 +1 @@ +{ "data": {} } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_duplicate_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_duplicate_fields.json new file mode 100644 index 000000000..8d6ada8b2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_duplicate_fields.json @@ -0,0 +1,10 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "address": { + "number": "308" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_service_returning_objects_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_service_returning_objects_array.json new file mode 100644 index 000000000..e84920a3d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_service_returning_objects_array.json @@ -0,0 +1,5 @@ +{ + "data": { + "searchVehicles": [{}, {}, {}] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_variables_and_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_variables_and_fragments.json new file mode 100644 index 000000000..4e808cd92 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/directives_with_variables_and_fragments.json @@ -0,0 +1,10 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "address": { + "street": "Negra Arroyo Lane" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/documentation.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/documentation.json new file mode 100644 index 000000000..435b94e43 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/documentation.json @@ -0,0 +1,80 @@ +{ + "data": { + "__schema": { + "description": "GraphQL service with documentation.", + "queryType": { + "fields": [ + { + "name": "greeting", + "description": "Greets a person with provided name.\n", + "type": { + "name": null, + "description": null, + "fields": null, + "ofType": { + "name": "String", + "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", + "fields": null + } + }, + "args": [ + { "name": "name", "description": "The name of the person" } + ] + }, + { + "name": "instrument", + "description": "Returns a predefined instrument.\n", + "type": { + "name": null, + "description": null, + "fields": null, + "ofType": { + "name": "Instrument", + "description": "Represents an instrument\n", + "fields": [ + { "name": "name", "description": "Name of the instrument" }, + { + "name": "type", + "description": "The type of the musical instrument" + } + ] + } + }, + "args": [] + } + ] + }, + "mutationType": { + "fields": [ + { + "name": "addShape", + "description": "Updates a shape in the database.\n", + "type": { + "name": null, + "description": null, + "fields": null, + "ofType": { + "name": "Shape", + "description": "Represents a shape\n", + "fields": [ + { "name": "name", "description": "Name of the shape" }, + { + "name": "edges", + "description": "Number of edges in the shape" + } + ] + } + }, + "args": [ + { "name": "name", "description": "Name of the new shape" }, + { + "name": "edges", + "description": "Number of edges of the new shape" + } + ] + } + ] + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json new file mode 100644 index 000000000..c166b664e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"isHoliday\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 19, "column": 3 }, + { "line": 20, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json new file mode 100644 index 000000000..34f51d3e2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"isHoliday\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 24, "column": 3 }, + { "line": 26, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json new file mode 100644 index 000000000..b3171246c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"isHoliday\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 30, "column": 3 }, + { "line": 31, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json new file mode 100644 index 000000000..e5d8e7625 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 35, "column": 3 }, + { "line": 41, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json new file mode 100644 index 000000000..479766e32 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 53, "column": 3 }, + { "line": 59, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json new file mode 100644 index 000000000..a4cd21253 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 68, "column": 3 }, + { "line": 88, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json new file mode 100644 index 000000000..ae6e51000 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json @@ -0,0 +1,18 @@ +{ + "errors": [ + { + "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 101, "column": 3 }, + { "line": 111, "column": 3 } + ] + }, + { + "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 121, "column": 3 }, + { "line": 123, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_1.json new file mode 100644 index 000000000..a133d4151 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_1.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Field(s) \"concat\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 127, "column": 3 }, + { "line": 129, "column": 3 }, + { "line": 130, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_2.json new file mode 100644 index 000000000..7fd83c4fa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_2.json @@ -0,0 +1,18 @@ +{ + "errors": [ + { + "message": "Field(s) \"concat\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 134, "column": 3 }, + { "line": 135, "column": 3 } + ] + }, + { + "message": "Field(s) \"getTotal\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 136, "column": 3 }, + { "line": 137, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_3.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_3.json new file mode 100644 index 000000000..7589c6deb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_list_args_3.json @@ -0,0 +1,21 @@ +{ + "errors": [ + { + "message": "Field(s) \"getTotal\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 141, "column": 3 }, + { "line": 143, "column": 3 }, + { "line": 144, "column": 3 }, + { "line": 145, "column": 3 } + ] + }, + { + "message": "Field(s) \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 146, "column": 3 }, + { "line": 147, "column": 3 }, + { "line": 148, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_record_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_record_types.json new file mode 100644 index 000000000..9ae251fd8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_record_types.json @@ -0,0 +1,14 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock", + "last": "Holmes" + }, + "address": { + "city": "London", + "street": "Baker Street" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json new file mode 100644 index 000000000..85059892c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json @@ -0,0 +1,18 @@ +{ + "errors": [ + { + "message": "Field(s) \"greet\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 2, "column": 3 }, + { "line": 3, "column": 3 } + ] + }, + { + "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 4, "column": 3 }, + { "line": 5, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json new file mode 100644 index 000000000..0b07c1fd4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 9, "column": 3 }, + { "line": 10, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json new file mode 100644 index 000000000..2574a1423 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json @@ -0,0 +1,11 @@ +{ + "errors": [ + { + "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", + "locations": [ + { "line": 14, "column": 3 }, + { "line": 15, "column": 3 } + ] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_inline_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_inline_fragments.json new file mode 100644 index 000000000..c33348d81 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_inline_fragments.json @@ -0,0 +1,32 @@ +{ + "data": { + "people": [ + { + "address": { + "street": "Baker Street", + "number": "221/B", + "city": "London" + } + }, + { + "address": { + "street": "Negra Arroyo Lane", + "number": "308", + "city": "Albuquerque" + } + }, + { + "address": { + "street": "Unknown", + "number": "Uknown", + "city": "Hogwarts" + } + } + ], + "students": [ + { "name": "John Doe" }, + { "name": "Jane Doe" }, + { "name": "Jonny Doe" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_input_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_input_variables.json new file mode 100644 index 000000000..68fe7be7b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_input_variables.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "There can be only one variable named \"$userName\"", + "locations": [{ "line": 1, "column": 21 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json new file mode 100644 index 000000000..206874bfa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json @@ -0,0 +1,9 @@ +{ + "data": { + "profile": { + "address": { + "city": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_block_string.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_block_string.json new file mode 100644 index 000000000..7d6fe6491 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_block_string.json @@ -0,0 +1,5 @@ +{ + "data": { + "sendEmail": "" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects.json new file mode 100644 index 000000000..f2bd55e40 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects.json @@ -0,0 +1,15 @@ +{ + "data": { + "getMovie": [ + { + "movieName": "Harry Potter and the Sorcerer's Stone", + "director": "Chris Columbus" + }, + { "movieName": "Sherlock Holmes", "director": "Dexter Fletcher" }, + { "movieName": "El Camino", "director": "Vince Gilligan" }, + { "movieName": "Escape Plan", "director": "Mikael Hafstrom" }, + { "movieName": "Papillon", "director": "Franklin Schaffner" }, + { "movieName": "The Fugitive", "director": "Andrew Davis" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json new file mode 100644 index 000000000..f2bd55e40 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json @@ -0,0 +1,15 @@ +{ + "data": { + "getMovie": [ + { + "movieName": "Harry Potter and the Sorcerer's Stone", + "director": "Chris Columbus" + }, + { "movieName": "Sherlock Holmes", "director": "Dexter Fletcher" }, + { "movieName": "El Camino", "director": "Vince Gilligan" }, + { "movieName": "Escape Plan", "director": "Mikael Hafstrom" }, + { "movieName": "Papillon", "director": "Franklin Schaffner" }, + { "movieName": "The Fugitive", "director": "Andrew Davis" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_string.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_string.json new file mode 100644 index 000000000..7d6fe6491 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/empty_string.json @@ -0,0 +1,5 @@ +{ + "data": { + "sendEmail": "" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum.json new file mode 100644 index 000000000..cad804d76 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum.json @@ -0,0 +1,7 @@ +{ + "data": { + "time": { + "weekday": "MONDAY" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter.json new file mode 100644 index 000000000..a1ccd8632 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter_as_string.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter_as_string.json new file mode 100644 index 000000000..2cc68c5d4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_input_parameter_as_string.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Enum \"Weekday\" cannot represent non-enum value: \"SUNDAY\"", + "locations": [{ "line": 2, "column": 22 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_inside_record.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_inside_record.json new file mode 100644 index 000000000..e7c66851e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_inside_record.json @@ -0,0 +1,5 @@ +{ + "data": { + "weekday": "WEDNESDAY" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_introspection.json new file mode 100644 index 000000000..f2ed9587f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_introspection.json @@ -0,0 +1,90 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "Company", "enumValues": null }, + { "name": "Task", "enumValues": null }, + { "name": "__Field", "enumValues": null }, + { + "name": "__TypeKind", + "enumValues": [ + { "name": "SCALAR" }, + { "name": "OBJECT" }, + { "name": "INTERFACE" }, + { "name": "UNION" }, + { "name": "ENUM" }, + { "name": "INPUT_OBJECT" }, + { "name": "LIST" }, + { "name": "NON_NULL" } + ] + }, + { "name": "Query", "enumValues": null }, + { "name": "__Schema", "enumValues": null }, + { "name": "__Type", "enumValues": null }, + { "name": "__EnumValue", "enumValues": null }, + { + "name": "__DirectiveLocation", + "enumValues": [ + { "name": "QUERY" }, + { "name": "MUTATION" }, + { "name": "SUBSCRIPTION" }, + { "name": "FIELD" }, + { "name": "FRAGMENT_DEFINITION" }, + { "name": "FRAGMENT_SPREAD" }, + { "name": "INLINE_FRAGMENT" }, + { "name": "VARIABLE_DEFINITION" }, + { "name": "SCHEMA" }, + { "name": "SCALAR" }, + { "name": "OBJECT" }, + { "name": "FIELD_DEFINITION" }, + { "name": "ARGUMENT_DEFINITION" }, + { "name": "INTERFACE" }, + { "name": "UNION" }, + { "name": "ENUM" }, + { "name": "ENUM_VALUE" }, + { "name": "INPUT_OBJECT" }, + { "name": "INPUT_FIELD_DEFINITION" } + ] + }, + { "name": "Time", "enumValues": null }, + { "name": "String", "enumValues": null }, + { "name": "Int", "enumValues": null }, + { "name": "Contact", "enumValues": null }, + { + "name": "Weekday", + "enumValues": [ + { "name": "SATURDAY" }, + { "name": "FRIDAY" }, + { "name": "THURSDAY" }, + { "name": "WEDNESDAY" }, + { "name": "TUESDAY" }, + { "name": "MONDAY" }, + { "name": "SUNDAY" } + ] + }, + { + "name": "Month", + "enumValues": [ + { "name": "DECEMBER" }, + { "name": "NOVEMBER" }, + { "name": "OCTOBER" }, + { "name": "SEPTEMBER" }, + { "name": "AUGUST" }, + { "name": "JULY" }, + { "name": "JUNE" }, + { "name": "MAY" }, + { "name": "APRIL" }, + { "name": "MARCH" }, + { "name": "FEBRUARY" }, + { "name": "JANUARY" } + ] + }, + { "name": "Project", "enumValues": null }, + { "name": "Worker", "enumValues": null }, + { "name": "__InputValue", "enumValues": null }, + { "name": "Boolean", "enumValues": null }, + { "name": "__Directive", "enumValues": null } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_invalid_input_parameter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_invalid_input_parameter.json new file mode 100644 index 000000000..88c49427e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_invalid_input_parameter.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Value \"FUNDAY\" does not exist in \"weekday\" enum.", + "locations": [{ "line": 2, "column": 22 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_default_value_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_default_value_with_variables.json new file mode 100644 index 000000000..a1ccd8632 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_default_value_with_variables.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_variables.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_type_variables.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_value_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_value_introspection.json new file mode 100644 index 000000000..f7d46e92f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_value_introspection.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"enumValues\" of type \"[__EnumValue!]\" must have a selection of subfields. Did you mean \"enumValues { ... }\"?", + "locations": [{ "line": 4, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_union.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_union.json new file mode 100644 index 000000000..01df6c23b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_union.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Invalid number", + "locations": [{ "line": 2, "column": 3 }], + "path": ["day"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned.json new file mode 100644 index 000000000..c54c52984 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned.json @@ -0,0 +1,5 @@ +{ + "data": { + "month": "Jan" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned_using_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned_using_variables.json new file mode 100644 index 000000000..30fd3f64a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/enum_with_values_assigned_using_variables.json @@ -0,0 +1,5 @@ +{ + "data": { + "month": "May" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_as_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_as_input.json new file mode 100644 index 000000000..85b80b421 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_as_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 2.8665000000000003 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_type_variable_with_default_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_type_variable_with_default_value.json new file mode 100644 index 000000000..1e2b776c8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/float_type_variable_with_default_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 9.599247 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_on_invalid_type.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_on_invalid_type.json new file mode 100644 index 000000000..d6c8643c3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_on_invalid_type.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Fragment \"data\" cannot be spread here as objects of type \"Query\" can never be of type \"Person\".", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_with_invalid_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_with_invalid_field.json new file mode 100644 index 000000000..7c0ab0134 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragment_with_invalid_field.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"invalid\" on type \"Person\".", + "locations": [{ "line": 7, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json new file mode 100644 index 000000000..140331091 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json @@ -0,0 +1,7 @@ +{ + "data": { + "teacher": { + "name": "Walter White" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_on_record_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_on_record_objects.json new file mode 100644 index 000000000..adebb185e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_on_record_objects.json @@ -0,0 +1,9 @@ +{ + "data": { + "people": [ + { "name": "Sherlock Holmes" }, + { "name": "Walter White" }, + { "name": "Tom Marvolo Riddle" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_querying_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_querying_service_objects.json new file mode 100644 index 000000000..a452e76ea --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_querying_service_objects.json @@ -0,0 +1,9 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_input_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_input_variables.json new file mode 100644 index 000000000..206874bfa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_input_variables.json @@ -0,0 +1,9 @@ +{ + "data": { + "profile": { + "address": { + "city": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_introspection.json new file mode 100644 index 000000000..273a7fc9b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_introspection.json @@ -0,0 +1,25 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "__Field" }, + { "name": "__TypeKind" }, + { "name": "Query" }, + { "name": "Address" }, + { "name": "__Schema" }, + { "name": "__Type" }, + { "name": "__EnumValue" }, + { "name": "__DirectiveLocation" }, + { "name": "String" }, + { "name": "Student" }, + { "name": "Int" }, + { "name": "Book" }, + { "name": "__InputValue" }, + { "name": "Course" }, + { "name": "Boolean" }, + { "name": "Person" }, + { "name": "__Directive" } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_invalid_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_invalid_introspection.json new file mode 100644 index 000000000..2bf053feb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_invalid_introspection.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"invalid\" on type \"__Type\".", + "locations": [{ "line": 17, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json new file mode 100644 index 000000000..bb4351e3e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json @@ -0,0 +1,26 @@ +{ + "data": { + "people": [ + { + "address": { + "city": "London" + } + }, + { + "address": { + "city": "Albuquerque" + } + }, + { + "address": { + "city": "Hogwarts" + } + } + ], + "students": [ + { "name": "John Doe" }, + { "name": "Jane Doe" }, + { "name": "Jonny Doe" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/functions_with_input_parameter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/functions_with_input_parameter.json new file mode 100644 index 000000000..64112e606 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/functions_with_input_parameter.json @@ -0,0 +1,5 @@ +{ + "data": { + "greet": "Hello, Thisaru" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/graphql_playground_introspection_query.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/graphql_playground_introspection_query.json new file mode 100644 index 000000000..2a1bbb249 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/graphql_playground_introspection_query.json @@ -0,0 +1,1464 @@ +{ + "data": { + "__schema": { + "queryType": { + "name": "Query" + }, + "mutationType": null, + "subscriptionType": null, + "types": [ + { + "kind": "ENUM", + "name": "Status", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "HOLD", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OPEN", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Field", + "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__TypeKind", + "description": "An enum describing what kind of type a given `__Type` is.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SCALAR", + "description": "Indicates this type is a scalar.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LIST", + "description": "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NON_NULL", + "description": "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Query", + "description": null, + "fields": [ + { + "name": "allLifts", + "description": null, + "args": [ + { + "name": "status", + "description": null, + "type": { + "kind": "ENUM", + "name": "Status", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Lift", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allTrails", + "description": null, + "args": [ + { + "name": "status", + "description": null, + "type": { + "kind": "ENUM", + "name": "Status", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Trail", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "lift", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Lift", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trail", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Trail", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "liftCount", + "description": null, + "args": [ + { + "name": "status", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "Status", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trailCount", + "description": null, + "args": [ + { + "name": "status", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "Status", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "search", + "description": null, + "args": [ + { + "name": "status", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "Status", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "UNION", + "name": "SearchResult", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Schema", + "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", + "fields": [ + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "types", + "description": "A list of all types supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "queryType", + "description": "The type that query operations will be rooted at.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mutationType", + "description": "If this server supports mutation, the type that mutation operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionType", + "description": "If this server support subscription, the type that subscription operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "directives", + "description": "A list of all directives supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Directive", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Type", + "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "fields": [ + { + "name": "kind", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__TypeKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fields", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Field", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "interfaces", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "possibleTypes", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumValues", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__EnumValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inputFields", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ofType", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__EnumValue", + "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__DirectiveLocation", + "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "QUERY", + "description": "Location adjacent to a query operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MUTATION", + "description": "Location adjacent to a mutation operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIPTION", + "description": "Location adjacent to a subscription operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD", + "description": "Location adjacent to a field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_DEFINITION", + "description": "Location adjacent to a fragment definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_SPREAD", + "description": "Location adjacent to a fragment spread.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INLINE_FRAGMENT", + "description": "Location adjacent to an inline fragment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "VARIABLE_DEFINITION", + "description": "Location adjacent to a variable definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCHEMA", + "description": "Location adjacent to a schema definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCALAR", + "description": "Location adjacent to a scalar definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Location adjacent to an object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD_DEFINITION", + "description": "Location adjacent to a field definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ARGUMENT_DEFINITION", + "description": "Location adjacent to an argument definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Location adjacent to an interface definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Location adjacent to a union definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Location adjacent to an enum definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM_VALUE", + "description": "Location adjacent to an enum value definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Location adjacent to an input object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_FIELD_DEFINITION", + "description": "Location adjacent to an input object field definition.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "UNION", + "name": "SearchResult", + "description": "auto-generated union type from Ballerina", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { "kind": "OBJECT", "name": "Lift", "ofType": null }, + { "kind": "OBJECT", "name": "Trail", "ofType": null } + ] + }, + { + "kind": "SCALAR", + "name": "String", + "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Int", + "description": "The `Int` scalar type represents non-fractional signed whole numeric values.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Lift", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "capacity", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "night", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "elevationgain", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trailAccess", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Trail", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Trail", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "difficulty", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "groomed", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trees", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "night", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "accessByLifts", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Lift", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__InputValue", + "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValue", + "description": "A GraphQL-formatted string representing the default value for this input value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Boolean", + "description": "The `Boolean` scalar type represents `true` or `false`.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Directive", + "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locations", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__DirectiveLocation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + } + ], + "directives": [ + { + "name": "include", + "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", + "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], + "args": [ + { + "name": "if", + "description": "Included when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ] + }, + { + "name": "skip", + "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", + "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], + "args": [ + { + "name": "if", + "description": "Skipped when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ] + }, + { + "name": "deprecated", + "description": "Marks an element of a GraphQL schema as no longer supported.", + "locations": ["FIELD_DEFINITION", "ENUM_VALUE"], + "args": [ + { + "name": "reason", + "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ] + } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json new file mode 100644 index 000000000..68ee6d39f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json @@ -0,0 +1 @@ +{ "data": null } diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths.json new file mode 100644 index 000000000..a452e76ea --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths.json @@ -0,0 +1,9 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_complete.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_complete.json new file mode 100644 index 000000000..111ce2e0e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_complete.json @@ -0,0 +1,11 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock", + "last": "Holmes" + }, + "age": 40 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_introspection.json new file mode 100644 index 000000000..4a1abb3a7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_introspection.json @@ -0,0 +1,101 @@ +{ + "data": { + "__schema": { + "types": [ + { + "name": "__Field", + "fields": [ + { "name": "name" }, + { "name": "description" }, + { "name": "args" }, + { "name": "type" }, + { "name": "isDeprecated" }, + { "name": "deprecationReason" } + ] + }, + { "name": "__TypeKind", "fields": null }, + { + "name": "address", + "fields": [ + { "name": "city" }, + { "name": "street" }, + { "name": "number" } + ] + }, + { "name": "Query", "fields": [{ "name": "profile" }] }, + { + "name": "__Schema", + "fields": [ + { "name": "description" }, + { "name": "types" }, + { "name": "queryType" }, + { "name": "mutationType" }, + { "name": "subscriptionType" }, + { "name": "directives" } + ] + }, + { + "name": "__Type", + "fields": [ + { "name": "kind" }, + { "name": "name" }, + { "name": "description" }, + { "name": "fields" }, + { "name": "interfaces" }, + { "name": "possibleTypes" }, + { "name": "enumValues" }, + { "name": "inputFields" }, + { "name": "ofType" } + ] + }, + { + "name": "__EnumValue", + "fields": [ + { "name": "name" }, + { "name": "description" }, + { "name": "isDeprecated" }, + { "name": "deprecationReason" } + ] + }, + { "name": "__DirectiveLocation", "fields": null }, + { + "name": "profile", + "fields": [ + { "name": "name" }, + { "name": "age" }, + { "name": "address" } + ] + }, + { "name": "String", "fields": null }, + { "name": "Int", "fields": null }, + { + "name": "name", + "fields": [ + { "name": "first" }, + { "name": "last" }, + { "name": "address" } + ] + }, + { + "name": "__InputValue", + "fields": [ + { "name": "name" }, + { "name": "description" }, + { "name": "type" }, + { "name": "defaultValue" } + ] + }, + { "name": "Boolean", "fields": null }, + { + "name": "__Directive", + "fields": [ + { "name": "name" }, + { "name": "description" }, + { "name": "locations" }, + { "name": "args" } + ] + } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json new file mode 100644 index 000000000..f8349f2be --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json @@ -0,0 +1,11 @@ +{ + "data": { + "profile": { + "personal": { + "name": { + "first": "Sherlock" + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json new file mode 100644 index 000000000..a8aa43bd9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json @@ -0,0 +1,10 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock", + "last": "Holmes" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json new file mode 100644 index 000000000..a8aa43bd9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json @@ -0,0 +1,10 @@ +{ + "data": { + "profile": { + "name": { + "first": "Sherlock", + "last": "Holmes" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json new file mode 100644 index 000000000..847c8db82 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json @@ -0,0 +1,11 @@ +{ + "data": { + "mountain": { + "trail": { + "getLift": { + "name": "Lift2" + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json new file mode 100644 index 000000000..117b87e60 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json @@ -0,0 +1,7 @@ +{ + "data": { + "lift": { + "name": "Lift1" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal.json new file mode 100644 index 000000000..f94453744 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal.json @@ -0,0 +1,5 @@ +{ + "data": { + "decimalId": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_array.json new file mode 100644 index 000000000..ad78b3067 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_array.json @@ -0,0 +1,9 @@ +{ + "data": { + "decimalArrayReturnRecord": { + "__typename": "Student5", + "id": 452, + "name": "Edward MacDell" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json new file mode 100644 index 000000000..a48fd1d58 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json @@ -0,0 +1,5 @@ +{ + "data": { + "decimalId1": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float.json new file mode 100644 index 000000000..e2f0cdc1a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float.json @@ -0,0 +1,5 @@ +{ + "data": { + "floatId": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array.json new file mode 100644 index 000000000..4c3e81bd9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array.json @@ -0,0 +1,9 @@ +{ + "data": { + "floatArrayReturnRecord": { + "__typename": "Student5", + "id": 422, + "name": "Elliot Birch" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array1.json new file mode 100644 index 000000000..bde35a164 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_array1.json @@ -0,0 +1,9 @@ +{ + "data": { + "floatArrayReturnRecordArray": [ + { "name": "Beth Match", "id": 789, "age": 15 }, + { "name": "Jo March", "id": 678, "age": 16 }, + { "name": "Amy March", "id": 543, "age": 12 } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_or_nil.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_or_nil.json new file mode 100644 index 000000000..a7a52f9b7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_float_or_nil.json @@ -0,0 +1,5 @@ +{ + "data": { + "floatId1": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int.json new file mode 100644 index 000000000..7064aa969 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int.json @@ -0,0 +1,5 @@ +{ + "data": { + "intId": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int1.json new file mode 100644 index 000000000..53ffd4f76 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int1.json @@ -0,0 +1,9 @@ +{ + "data": { + "intIdReturnRecord": { + "__typename": "Student5", + "id": 2, + "name": "Jennifer Flackett" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_array.json new file mode 100644 index 000000000..7eecb6d29 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_array.json @@ -0,0 +1,9 @@ +{ + "data": { + "intArrayReturnRecord": { + "__typename": "Student5", + "id": 333, + "name": "Antoni Porowski" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_or_nil.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_or_nil.json new file mode 100644 index 000000000..659f9cf55 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_int_or_nil.json @@ -0,0 +1,5 @@ +{ + "data": { + "intId1": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record.json new file mode 100644 index 000000000..de401d9ce --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record.json @@ -0,0 +1,9 @@ +{ + "data": { + "stringIdReturnRecord": { + "__typename": "PersonId", + "id": 543, + "name": "Marmee March" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record_array.json new file mode 100644 index 000000000..dee232d15 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_return_record_array.json @@ -0,0 +1,9 @@ +{ + "data": { + "stringArrayReturnRecordArray": [ + { "__typename": "PersonId", "id": 789, "name": "Beth Match" }, + { "__typename": "PersonId", "id": 678, "name": "Jo March" }, + { "__typename": "PersonId", "id": 543, "name": "Amy March" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string.json new file mode 100644 index 000000000..13993f1fc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string.json @@ -0,0 +1,5 @@ +{ + "data": { + "stringId": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_array.json new file mode 100644 index 000000000..8374cf84e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_array.json @@ -0,0 +1,9 @@ +{ + "data": { + "stringArrayReturnRecord": { + "__typename": "Student5", + "id": 212, + "name": "Andrew Glouberman" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_or_nil.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_or_nil.json new file mode 100644 index 000000000..f4b2fab9b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_string_or_nil.json @@ -0,0 +1,5 @@ +{ + "data": { + "stringId1": "Hello, World" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid.json new file mode 100644 index 000000000..df3b81d37 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid.json @@ -0,0 +1,9 @@ +{ + "data": { + "uuidReturnRecord": { + "__typename": "Student5", + "id": 2678, + "name": "Abuela Alvarez" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array.json new file mode 100644 index 000000000..c7441be15 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array.json @@ -0,0 +1,9 @@ +{ + "data": { + "uuidArrayReturnRecord": { + "__typename": "Student5", + "id": 678, + "name": "Andy Garcia" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json new file mode 100644 index 000000000..a15f7f19d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json @@ -0,0 +1,9 @@ +{ + "data": { + "uuidArrayReturnRecord1": { + "__typename": "Student5", + "id": 563, + "name": "Aretha Franklin" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_introspection_query.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_introspection_query.json new file mode 100644 index 000000000..c0ce96840 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/id_introspection_query.json @@ -0,0 +1,635 @@ +{ + "data": { + "__schema": { + "types": [ + { + "kind": "OBJECT", + "name": "__Field", + "fields": [ + { + "name": "name", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String" + } + } + }, + { + "name": "description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "args", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + }, + { + "name": "type", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type" + } + } + }, + { + "name": "isDeprecated", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean" + } + } + }, + { + "name": "deprecationReason", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + ], + "inputFields": null + }, + { + "kind": "ENUM", + "name": "__TypeKind", + "fields": null, + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "Query", + "fields": [ + { + "name": "student1", + "args": [ + { + "name": "id1", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID" + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Student1" + } + } + }, + { + "name": "student2", + "args": [ + { + "name": "id2", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Student2" + } + } + }, + { + "name": "student3", + "args": [ + { + "name": "id3", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Student3" + } + } + }, + { + "name": "student4", + "args": [ + { + "name": "id4", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID" + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Student4" + } + } + } + ], + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "__Schema", + "fields": [ + { + "name": "description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "types", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + }, + { + "name": "queryType", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type" + } + } + }, + { + "name": "mutationType", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + { + "name": "subscriptionType", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + { + "name": "directives", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + } + ], + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "__Type", + "fields": [ + { + "name": "kind", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__TypeKind" + } + } + }, + { + "name": "name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "fields", + "args": [ + { + "name": "includeDeprecated", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null + } + } + }, + { + "name": "interfaces", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null + } + } + }, + { + "name": "possibleTypes", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null + } + } + }, + { + "name": "enumValues", + "args": [ + { + "name": "includeDeprecated", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null + } + } + }, + { + "name": "inputFields", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null + } + } + }, + { + "name": "ofType", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + ], + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "__EnumValue", + "fields": [ + { + "name": "name", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String" + } + } + }, + { + "name": "description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "isDeprecated", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean" + } + } + }, + { + "name": "deprecationReason", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + ], + "inputFields": null + }, + { + "kind": "ENUM", + "name": "__DirectiveLocation", + "fields": null, + "inputFields": null + }, + { + "kind": "SCALAR", + "name": "String", + "fields": null, + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "Student3", + "fields": [ + { + "name": "id", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + } + ], + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "Student4", + "fields": [ + { + "name": "id", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID" + } + } + } + ], + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "Student1", + "fields": [ + { + "name": "id", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID" + } + } + } + ], + "inputFields": null + }, + { "kind": "SCALAR", "name": "ID", "fields": null, "inputFields": null }, + { + "kind": "OBJECT", + "name": "Student2", + "fields": [ + { + "name": "id", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + } + ], + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "__InputValue", + "fields": [ + { + "name": "name", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String" + } + } + }, + { + "name": "description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "type", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type" + } + } + }, + { + "name": "defaultValue", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + ], + "inputFields": null + }, + { + "kind": "SCALAR", + "name": "Boolean", + "fields": null, + "inputFields": null + }, + { + "kind": "OBJECT", + "name": "__Directive", + "fields": [ + { + "name": "name", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String" + } + } + }, + { + "name": "description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "name": "locations", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + }, + { + "name": "args", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null + } + } + } + ], + "inputFields": null + } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragment.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragment.json new file mode 100644 index 000000000..bb4351e3e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragment.json @@ -0,0 +1,26 @@ +{ + "data": { + "people": [ + { + "address": { + "city": "London" + } + }, + { + "address": { + "city": "Albuquerque" + } + }, + { + "address": { + "city": "Hogwarts" + } + } + ], + "students": [ + { "name": "John Doe" }, + { "name": "Jane Doe" }, + { "name": "Jonny Doe" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_on_record_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_on_record_objects.json new file mode 100644 index 000000000..be0b60da7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_on_record_objects.json @@ -0,0 +1,10 @@ +{ + "data": { + "teacher": { + "name": "Walter White" + }, + "student": { + "age": 25 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_with_variables.json new file mode 100644 index 000000000..28113d05c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_fragments_with_variables.json @@ -0,0 +1,10 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "address": { + "city": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json new file mode 100644 index 000000000..38d3deeef --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json @@ -0,0 +1,16 @@ +{ + "data": { + "teacher": { + "name": "Walter White", + "address": { + "city": "Albuquerque" + } + }, + "student": { + "age": 25, + "address": { + "city": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object.json new file mode 100644 index 000000000..4b6a279f7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object.json @@ -0,0 +1,7 @@ +{ + "data": { + "searchProfile": { + "name": "Jessie Pinkman" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json new file mode 100644 index 000000000..58b9a1908 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json @@ -0,0 +1,8 @@ +{ + "data": { + "book": [ + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json new file mode 100644 index 000000000..d7ac658ba --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Variable \"$bName\" is not defined.", + "locations": [{ "line": 4, "column": 18 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_variables.json new file mode 100644 index 000000000..58b9a1908 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_include_fields_with_variables.json @@ -0,0 +1,8 @@ +{ + "data": { + "book": [ + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_type_variables_inside_list_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_type_variables_inside_list_value.json new file mode 100644 index 000000000..401b3d559 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_type_variables_inside_list_value.json @@ -0,0 +1,9 @@ +{ + "data": { + "getSuggestions": [ + { "movieName": "Escape Plan" }, + { "movieName": "Papillon" }, + { "movieName": "The Fugitive" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json new file mode 100644 index 000000000..3bf258c00 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Unknown type \"Details\".", + "locations": [{ "line": 1, "column": 2 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_default_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_default_value.json new file mode 100644 index 000000000..58b9a1908 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_default_value.json @@ -0,0 +1,8 @@ +{ + "data": { + "book": [ + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_duplicate_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_duplicate_fields.json new file mode 100644 index 000000000..284bbb0e2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_duplicate_fields.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Syntax Error: Duplicate input object field \"bookName\", found Name \"bookName\".", + "locations": [{ "line": 5, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_enum_type_argument.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_enum_type_argument.json new file mode 100644 index 000000000..a1ccd8632 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_enum_type_argument.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_float_type_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_float_type_variables.json new file mode 100644 index 000000000..b29e78c0a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_float_type_variables.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 155.45250000000001 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_fragment_and_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_fragment_and_variables.json new file mode 100644 index 000000000..3cc0fd8d5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_fragment_and_variables.json @@ -0,0 +1,14 @@ +{ + "data": { + "book": [ + { + "name": "Harry Potter and the Sorcerer's Stone", + "author": "J.K Rowling" + }, + { + "name": "Harry Potter and the Chamber of Secrets", + "author": "J.K Rowling" + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json new file mode 100644 index 000000000..105af7aa0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json @@ -0,0 +1,10 @@ +{ + "data": { + "book": [ + { "name": "The Sign of Four" }, + { "name": "The Valley of Fear" }, + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments1.json new file mode 100644 index 000000000..ae1bb0e00 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments1.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "String cannot represent non String value: 5", + "locations": [{ "line": 2, "column": 40 }] + }, + { + "message": "Int cannot represent non Int value: Arthur", + "locations": [{ "line": 2, "column": 48 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments2.json new file mode 100644 index 000000000..0c371cfaf --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_arguments2.json @@ -0,0 +1,24 @@ +{ + "errors": [ + { + "message": "String! cannot represent non String! value: {name: \"s\"}", + "locations": [{ "line": 4, "column": 7 }] + }, + { + "message": "Int! cannot represent non Int! value: {}", + "locations": [{ "line": 5, "column": 7 }] + }, + { + "message": "String! cannot represent non String! value: {}", + "locations": [{ "line": 1, "column": 43 }] + }, + { + "message": "Int cannot represent non Int value: {}", + "locations": [{ "line": 1, "column": 53 }] + }, + { + "message": "String! cannot represent non String! value: {}", + "locations": [{ "line": 7, "column": 16 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables1.json new file mode 100644 index 000000000..a415f55fc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables1.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Int cannot represent non Int value: 70.5", + "locations": [{ "line": 2, "column": 30 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables2.json new file mode 100644 index 000000000..504af0ec7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_invalid_type_variables2.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "String cannot represent non String value: {}", + "locations": [{ "line": 10, "column": 16 }] + }, + { + "message": "Int cannot represent non Int value: {}", + "locations": [{ "line": 10, "column": 16 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_arguments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_arguments.json new file mode 100644 index 000000000..e889ee447 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_arguments.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"profileDetail.name\" of required type \"String!\" was not provided.", + "locations": [{ "line": 2, "column": 17 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json new file mode 100644 index 000000000..58b9a1908 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json @@ -0,0 +1,8 @@ +{ + "data": { + "book": [ + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_variables_arguments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_variables_arguments.json new file mode 100644 index 000000000..e4f5c7087 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_missing_variables_arguments.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"name\" of required type \"String!\" was not provided.", + "locations": [{ "line": 6, "column": 16 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_input_object_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_input_object_variables.json new file mode 100644 index 000000000..105af7aa0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_input_object_variables.json @@ -0,0 +1,10 @@ +{ + "data": { + "book": [ + { "name": "The Sign of Four" }, + { "name": "The Valley of Fear" }, + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_object.json new file mode 100644 index 000000000..7bd86ea2d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_nested_object.json @@ -0,0 +1,16 @@ +{ + "data": { + "book": [ + { "name": "The Sign of Four", "author": "Athur Conan Doyle" }, + { "name": "The Valley of Fear", "author": "Athur Conan Doyle" }, + { + "name": "Harry Potter and the Sorcerer's Stone", + "author": "J.K Rowling" + }, + { + "name": "Harry Potter and the Chamber of Secrets", + "author": "J.K Rowling" + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_undefined_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_undefined_fields.json new file mode 100644 index 000000000..121b649b4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_undefined_fields.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Field \"address\" is not defined by type \"author\".", + "locations": [{ "line": 6, "column": 45 }] + }, + { + "message": "Field \"year\" is not defined by type \"movie\".", + "locations": [{ "line": 7, "column": 39 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_unexpected_variable_values.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_unexpected_variable_values.json new file mode 100644 index 000000000..4d986aac7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_unexpected_variable_values.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "ProfileDetail cannot represent non ProfileDetail value: [{\"name\":\"arthur\"},{\"name\":\"J.K Rowling\"}]", + "locations": [{ "line": 7, "column": 18 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_variables.json new file mode 100644 index 000000000..3269eeb53 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_with_variables.json @@ -0,0 +1,7 @@ +{ + "data": { + "searchProfile": { + "name": "Sherlock Holmes" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_without_optional_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_without_optional_fields.json new file mode 100644 index 000000000..105af7aa0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_object_without_optional_fields.json @@ -0,0 +1,10 @@ +{ + "data": { + "book": [ + { "name": "The Sign of Four" }, + { "name": "The Valley of Fear" }, + { "name": "Harry Potter and the Sorcerer's Stone" }, + { "name": "Harry Potter and the Chamber of Secrets" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json new file mode 100644 index 000000000..e9cb4ec88 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json @@ -0,0 +1,5 @@ +{ + "data": { + "isLegal": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_escape_characters.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_escape_characters.json new file mode 100644 index 000000000..9962e9bc6 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_escape_characters.json @@ -0,0 +1,5 @@ +{ + "data": { + "type": "1.0.0" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter.json new file mode 100644 index 000000000..113ebea6d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter.json @@ -0,0 +1,5 @@ +{ + "data": { + "name": "trigonocephalus" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_array.json new file mode 100644 index 000000000..5c079b637 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_array.json @@ -0,0 +1,5 @@ +{ + "data": { + "names": ["trigonocephalus", "philarchus"] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference.json new file mode 100644 index 000000000..11f8995a4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference.json @@ -0,0 +1,5 @@ +{ + "data": { + "city": "Albuquerque" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json new file mode 100644 index 000000000..ceba3352e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json @@ -0,0 +1,5 @@ +{ + "data": { + "cities": ["Albuquerque", "Albuquerque"] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json new file mode 100644 index 000000000..890692ada --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json @@ -0,0 +1,5 @@ +{ + "data": { + "commonName": "Sri Lankan Tree Nymph" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json new file mode 100644 index 000000000..d76a05703 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json @@ -0,0 +1,5 @@ +{ + "data": { + "ownerName": "Sam" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json new file mode 100644 index 000000000..fabe2fcfc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json @@ -0,0 +1,5 @@ +{ + "data": { + "ownerName": "Ruwangi" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_unicode_characters.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_unicode_characters.json new file mode 100644 index 000000000..ce814984e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/input_with_unicode_characters.json @@ -0,0 +1,5 @@ +{ + "data": { + "version": "SwanLake" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_field.json new file mode 100644 index 000000000..fe1c2930c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_field.json @@ -0,0 +1,5 @@ +{ + "data": { + "characters": [{ "name": "Luke Skywalker" }, { "name": "R2D2" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_introspection.json new file mode 100644 index 000000000..657292c8c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interface_introspection.json @@ -0,0 +1,40 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "Human", "kind": "OBJECT", "possibleTypes": null }, + { "name": "__Field", "kind": "OBJECT", "possibleTypes": null }, + { "name": "__TypeKind", "kind": "ENUM", "possibleTypes": null }, + { "name": "Query", "kind": "OBJECT", "possibleTypes": null }, + { + "name": "Character", + "kind": "INTERFACE", + "possibleTypes": [ + { "name": "Human", "kind": "OBJECT" }, + { "name": "Droid", "kind": "OBJECT" } + ] + }, + { "name": "__Schema", "kind": "OBJECT", "possibleTypes": null }, + { "name": "__Type", "kind": "OBJECT", "possibleTypes": null }, + { "name": "__EnumValue", "kind": "OBJECT", "possibleTypes": null }, + { + "name": "__DirectiveLocation", + "kind": "ENUM", + "possibleTypes": null + }, + { "name": "String", "kind": "SCALAR", "possibleTypes": null }, + { "name": "Int", "kind": "SCALAR", "possibleTypes": null }, + { "name": "Droid", "kind": "OBJECT", "possibleTypes": null }, + { "name": "Starship", "kind": "OBJECT", "possibleTypes": null }, + { + "name": "Ship", + "kind": "INTERFACE", + "possibleTypes": [{ "name": "Starship", "kind": "OBJECT" }] + }, + { "name": "__InputValue", "kind": "OBJECT", "possibleTypes": null }, + { "name": "Boolean", "kind": "SCALAR", "possibleTypes": null }, + { "name": "__Directive", "kind": "OBJECT", "possibleTypes": null } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces.json new file mode 100644 index 000000000..697c6cb19 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces.json @@ -0,0 +1,8 @@ +{ + "data": { + "characters": [ + { "name": "Luke Skywalker", "id": 1 }, + { "name": "R2D2", "year": 1977 } + ] + } +} diff --git a/ballerina-tests/tests/resources/expected_results/interfaces_implementing_interface_introsepction.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_implementing_interface_introsepction.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/interfaces_implementing_interface_introsepction.json rename to ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_implementing_interface_introsepction.json diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_interface_type_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_interface_type_array.json new file mode 100644 index 000000000..7d8aab939 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_interface_type_array.json @@ -0,0 +1,20 @@ +{ + "data": { + "ships": [ + { + "id": "E1", + "enemyShips": [ + { "id": "E3", "driver": "Han" }, + { "id": "E4", "driver": "Leia" } + ] + }, + { + "id": "E2", + "enemyShips": [ + { "id": "E3", "driver": "Han" }, + { "id": "E4", "driver": "Leia" } + ] + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_invalid_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_invalid_field.json new file mode 100644 index 000000000..77f82bd66 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_invalid_field.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"age\" on type \"Character\". Did you mean to use a fragment on a subtype?", + "locations": [{ "line": 9, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_nested_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_nested_fragments.json new file mode 100644 index 000000000..697c6cb19 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_nested_fragments.json @@ -0,0 +1,8 @@ +{ + "data": { + "characters": [ + { "name": "Luke Skywalker", "id": 1 }, + { "name": "R2D2", "year": 1977 } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_type_name_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_type_name_introspection.json new file mode 100644 index 000000000..09e9fe782 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/interfaces_with_type_name_introspection.json @@ -0,0 +1,8 @@ +{ + "data": { + "characters": [ + { "__typename": "Human", "name": "Luke Skywalker", "id": 1 }, + { "__typename": "Droid", "name": "R2D2", "year": 1977 } + ] + } +} diff --git a/ballerina-tests/tests/resources/expected_results/introspection_on_input_object_having_defaultable_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_input_object_having_defaultable_fields.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/introspection_on_input_object_having_defaultable_fields.json rename to ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_input_object_having_defaultable_fields.json diff --git a/ballerina-tests/tests/resources/expected_results/introspection_on_inputs_with_default_values.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_inputs_with_default_values.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/introspection_on_inputs_with_default_values.json rename to ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_inputs_with_default_values.json diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_service_with_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_service_with_input_objects.json new file mode 100644 index 000000000..140fbd69b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_on_service_with_input_objects.json @@ -0,0 +1,138 @@ +{ + "data": { + "__schema": { + "types": [ + { + "name": "Movie", + "inputFields": [ + { + "name": "movieName", + "type": { + "kind": "NON_NULL" + } + }, + { + "name": "director", + "type": { + "kind": "SCALAR" + } + } + ] + }, + { "name": "__Field", "inputFields": null }, + { "name": "__TypeKind", "inputFields": null }, + { "name": "Query", "inputFields": null }, + { "name": "Address", "inputFields": null }, + { "name": "__Schema", "inputFields": null }, + { "name": "__Type", "inputFields": null }, + { "name": "__EnumValue", "inputFields": null }, + { "name": "__DirectiveLocation", "inputFields": null }, + { "name": "String", "inputFields": null }, + { + "name": "Info", + "inputFields": [ + { + "name": "bookName", + "type": { + "kind": "NON_NULL" + } + }, + { + "name": "edition", + "type": { + "kind": "NON_NULL" + } + }, + { + "name": "author", + "type": { + "kind": "NON_NULL" + } + }, + { + "name": "movie", + "type": { + "kind": "INPUT_OBJECT" + } + } + ] + }, + { "name": "Int", "inputFields": null }, + { + "name": "Date", + "inputFields": [ + { + "name": "day", + "type": { + "kind": "NON_NULL" + } + } + ] + }, + { + "name": "Weight", + "inputFields": [ + { + "name": "weightInKg", + "type": { + "kind": "NON_NULL" + } + } + ] + }, + { + "name": "DefaultPerson", + "inputFields": [ + { + "name": "name", + "type": { + "kind": "NON_NULL" + } + }, + { + "name": "addresses", + "type": { + "kind": "NON_NULL" + } + } + ] + }, + { "name": "Weekday", "inputFields": null }, + { "name": "Float", "inputFields": null }, + { + "name": "ProfileDetail", + "inputFields": [ + { + "name": "name", + "type": { + "kind": "NON_NULL" + } + }, + { + "name": "age", + "type": { + "kind": "SCALAR" + } + } + ] + }, + { "name": "Book", "inputFields": null }, + { + "name": "WeightInKg", + "inputFields": [ + { + "name": "weight", + "type": { + "kind": "NON_NULL" + } + } + ] + }, + { "name": "__InputValue", "inputFields": null }, + { "name": "Boolean", "inputFields": null }, + { "name": "Person", "inputFields": null }, + { "name": "__Directive", "inputFields": null } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_query_with_missing_selection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_query_with_missing_selection.json new file mode 100644 index 000000000..c406fcd8e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/introspection_query_with_missing_selection.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"__schema\" of type \"__Schema\" must have a selection of subfields. Did you mean \"__schema { ... }\"?", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_block_strings.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_block_strings.json new file mode 100644 index 000000000..8299908b4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_block_strings.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Syntax Error: Expected \":\", found Name \"GraphQL\".", + "locations": [{ "line": 6, "column": 13 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json new file mode 100644 index 000000000..c198723db --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Value \"SNDAY\" does not exist in \"weekday\" enum.", + "locations": [{ "line": 1, "column": 17 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_hierarchical_resource_paths.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_hierarchical_resource_paths.json new file mode 100644 index 000000000..63d99f72b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_hierarchical_resource_paths.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"middle\" on type \"name\".", + "locations": [{ "line": 5, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_introspection_query.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_introspection_query.json new file mode 100644 index 000000000..b00790ced --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_introspection_query.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"greet\" on type \"__Schema\".", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_for_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_for_input_objects.json new file mode 100644 index 000000000..8ae5f5f44 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_for_input_objects.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "TvSeries! cannot represent non TvSeries! value: [{name: \"Breaking Bad\", episodes:[{title: \"Cancer Man\", newCharacters:[true, \"graphql\"]}]}]", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects.json new file mode 100644 index 000000000..4b3a4356f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "String cannot represent non String value: true", + "locations": [{ "line": 5, "column": 57 }] + }, + { + "message": "String cannot represent non String value: graphql", + "locations": [{ "line": 5, "column": 63 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json new file mode 100644 index 000000000..05b24fe82 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "String cannot represent non String value: true", + "locations": [{ "line": 2, "column": 23 }] + }, + { + "message": "String cannot represent non String value: 44", + "locations": [{ "line": 2, "column": 23 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_mutation.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_mutation.json new file mode 100644 index 000000000..bd135a34e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_mutation.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"setAge\" on type \"Mutation\".", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_from_service_object_resource.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_from_service_object_resource.json new file mode 100644 index 000000000..b517935d4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_from_service_object_resource.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"nonExisting\" on type \"Name\".", + "locations": [{ "line": 4, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json new file mode 100644 index 000000000..06ed6b37a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"name\" on type \"StudentService_TeacherService\". Did you mean to use a fragment on \"StudentService\" or \"TeacherService\"?", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_schema_introspection_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_schema_introspection_field.json new file mode 100644 index 000000000..44061a334 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_schema_introspection_field.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"__schema\" on type \"Person\".", + "locations": [{ "line": 4, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_spread_inline_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_spread_inline_fragments.json new file mode 100644 index 000000000..13051d890 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_spread_inline_fragments.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Fragment cannot be spread here as objects of type \"__Type\" can never be of type \"Student\".", + "locations": [{ "line": 4, "column": 7 }] + }, + { + "message": "Fragment cannot be spread here as objects of type \"__Type\" can never be of type \"Person\".", + "locations": [{ "line": 7, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json new file mode 100644 index 000000000..f75c501ac --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "[Episode!] cannot represent non [Episode!] value: {title: \"Cancer Man\", newCharacters:[\"paul\"]}", + "locations": [{ "line": 5, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_variables_inside_list_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_variables_inside_list_value.json new file mode 100644 index 000000000..acfe51413 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/invalid_variables_inside_list_value.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Variable \"p1\" of type \"ProfileDetail\" used in position expecting type \"ProfileDetail!\".", + "locations": [{ "line": 2, "column": 34 }] + }, + { + "message": "Variable \"$p2\" of required type ProfileDetail! was not provided.", + "locations": [{ "line": 2, "column": 39 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input.json new file mode 100644 index 000000000..9ec61f40a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Hello! This is Ballerina GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_empty_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_empty_value.json new file mode 100644 index 000000000..9f299a7c1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_empty_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Word list is empty" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_invalid_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_invalid_variables.json new file mode 100644 index 000000000..cacd6625e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_invalid_variables.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "words: In element #1:String cannot represent non String value: true", + "locations": [{ "line": 2, "column": 18 }] + }, + { + "message": "words: In element #3:String cannot represent non String value: 4", + "locations": [{ "line": 2, "column": 18 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_null_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_null_value.json new file mode 100644 index 000000000..723a3efe4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_null_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Hello! This is a Null Value ->" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_variable.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_variable.json new file mode 100644 index 000000000..9ec61f40a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_input_with_variable.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Hello! This is Ballerina GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_inputs_with_nested_list.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_inputs_with_nested_list.json new file mode 100644 index 000000000..6d156c945 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_inputs_with_nested_list.json @@ -0,0 +1,5 @@ +{ + "data": { + "getTotal": [9.0, 22.0, 27.0] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_inside_list_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_inside_list_value.json new file mode 100644 index 000000000..6d156c945 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_inside_list_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "getTotal": [9.0, 22.0, 27.0] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_input_objects.json new file mode 100644 index 000000000..ae0cf9721 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_input_objects.json @@ -0,0 +1,5 @@ +{ + "data": { + "getSuggestions": [{ "movieName": "El Camino" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json new file mode 100644 index 000000000..6b04ed885 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "tvSeries: In element #1:[Episode!] cannot represent non [Episode!] value: true", + "locations": [{ "line": 2, "column": 29 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json new file mode 100644 index 000000000..e1d5c8c94 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "tvSeries: In element #0:String cannot represent non String value: true", + "locations": [{ "line": 2, "column": 29 }] + }, + { + "message": "tvSeries: In element #0:String cannot represent non String value: 1", + "locations": [{ "line": 2, "column": 29 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json new file mode 100644 index 000000000..401b3d559 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json @@ -0,0 +1,9 @@ +{ + "data": { + "getSuggestions": [ + { "movieName": "Escape Plan" }, + { "movieName": "Papillon" }, + { "movieName": "The Fugitive" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_default_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_default_value.json new file mode 100644 index 000000000..f929145d9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_default_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "isIncludeHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_enum_values.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_enum_values.json new file mode 100644 index 000000000..0e1b69eeb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_enum_values.json @@ -0,0 +1,5 @@ +{ + "data": { + "isIncludeHoliday": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_input_objects.json new file mode 100644 index 000000000..ae0cf9721 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_input_objects.json @@ -0,0 +1,5 @@ +{ + "data": { + "getSuggestions": [{ "movieName": "El Camino" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_enum_values.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_enum_values.json new file mode 100644 index 000000000..fd3f7adc8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_enum_values.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Value \"WEdnesday\" does not exist in \"days\" enum.", + "locations": [{ "line": 2, "column": 62 }] + }, + { + "message": "days: In element #5:Enum \"Weekday\" cannot represent non-enum value: \"4\"", + "locations": [{ "line": 2, "column": 73 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json new file mode 100644 index 000000000..9dc4634d9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "tvSeries: In element #1:[Episode!] cannot represent non [Episode!] value: true", + "locations": [{ "line": 5, "column": 41 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json new file mode 100644 index 000000000..7a8d12412 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "tvSeries: In element #0:String cannot represent non String value: true", + "locations": [{ "line": 8, "column": 43 }] + }, + { + "message": "tvSeries: In element #0:String cannot represent non String value: 4", + "locations": [{ "line": 8, "column": 49 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json new file mode 100644 index 000000000..5bad1d721 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Variable \"words: In element #3:\" expected value of type \"String\", found Ballerina", + "locations": [{ "line": 1, "column": 52 }] + }, + { + "message": "Variable \"words: In element #4:\" expected value of type \"String\", found true", + "locations": [{ "line": 1, "column": 63 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json new file mode 100644 index 000000000..0d336822a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json @@ -0,0 +1,28 @@ +{ + "errors": [ + { + "message": "Variable \"words: In element #0:\" expected value of type \"Int\", found Hello!", + "locations": [{ "line": 1, "column": 25 }] + }, + { + "message": "Variable \"words: In element #1:\" expected value of type \"Int\", found This", + "locations": [{ "line": 1, "column": 35 }] + }, + { + "message": "Variable \"words: In element #2:\" expected value of type \"Int\", found is", + "locations": [{ "line": 1, "column": 43 }] + }, + { + "message": "Variable \"words: In element #3:\" expected value of type \"Int\", found Ballerina", + "locations": [{ "line": 1, "column": 49 }] + }, + { + "message": "Variable \"words: In element #4:\" expected value of type \"Int\", found GraphQL", + "locations": [{ "line": 1, "column": 62 }] + }, + { + "message": "Variable \"words\" of type \"[Int]\" used in position expecting type \"[String]\".", + "locations": [{ "line": 2, "column": 18 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json new file mode 100644 index 000000000..77a146683 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Variable \"prices: In element #0: In element #1:\" expected value of type \"Float!\", found true", + "locations": [{ "line": 1, "column": 36 }] + }, + { + "message": "Variable \"prices: In element #1:\" expected value of type \"[Float!]!\", found false", + "locations": [{ "line": 1, "column": 46 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json new file mode 100644 index 000000000..4aa1afe9e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json @@ -0,0 +1,20 @@ +{ + "errors": [ + { + "message": "Variable \"prices: In element #0:\" expected value of type \"[Float!]!\", found 2", + "locations": [{ "line": 1, "column": 32 }] + }, + { + "message": "Variable \"prices: In element #1:\" expected value of type \"[Float!]!\", found 3", + "locations": [{ "line": 1, "column": 35 }] + }, + { + "message": "Variable \"prices: In element #2:\" expected value of type \"[Float!]!\", found 4", + "locations": [{ "line": 1, "column": 38 }] + }, + { + "message": "Variable \"prices: In element #3:\" expected value of type \"[Float!]!\", found 5", + "locations": [{ "line": 1, "column": 41 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json new file mode 100644 index 000000000..b5025146c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json @@ -0,0 +1,16 @@ +{ + "errors": [ + { + "message": "Variable \"prices: In element #0:\" expected value of type \"[Float!]!\", found []", + "locations": [{ "line": 1, "column": 33 }] + }, + { + "message": "Variable \"prices: In element #2: In element #0:\" expected value of type \"Float!\", found null", + "locations": [{ "line": 1, "column": 45 }] + }, + { + "message": "Variable \"prices: In element #3:\" expected value of type \"[Float!]!\", found null", + "locations": [{ "line": 1, "column": 52 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json new file mode 100644 index 000000000..2d3565fc4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "[[Float!]!]! cannot represent non [[Float!]!]! value: null", + "locations": [{ "line": 1, "column": 31 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json new file mode 100644 index 000000000..8dd2924f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Variable \"profileDetail: In element #1:\" expected value of type \"ProfileDetail\", found []", + "locations": [{ "line": 1, "column": 50 }] + }, + { + "message": "Variable \"profileDetail\" of type \"[ProfileDetail]\" used in position expecting type \"[ProfileDetail!]!\".", + "locations": [{ "line": 2, "column": 33 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json new file mode 100644 index 000000000..965f45eca --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Variable \"days\" of type \"[Weekday]\" used in position expecting type \"[Weekday!]!\".", + "locations": [{ "line": 2, "column": 27 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json new file mode 100644 index 000000000..784f9f6a8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Value \"TUSDAY\" does not exist in \"days\" enum.", + "locations": [{ "line": 1, "column": 45 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json new file mode 100644 index 000000000..401b3d559 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json @@ -0,0 +1,9 @@ +{ + "data": { + "getSuggestions": [ + { "movieName": "Escape Plan" }, + { "movieName": "Papillon" }, + { "movieName": "The Fugitive" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_1.json new file mode 100644 index 000000000..9ec61f40a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_1.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Hello! This is Ballerina GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_2.json new file mode 100644 index 000000000..9f299a7c1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_2.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Word list is empty" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_3.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_3.json new file mode 100644 index 000000000..92622f1f8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_3.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Hello GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_4.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_4.json new file mode 100644 index 000000000..60938fc7f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_4.json @@ -0,0 +1,5 @@ +{ + "data": { + "getTotal": [6.0, 155.0] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_5.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_5.json new file mode 100644 index 000000000..df3ea9b11 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_5.json @@ -0,0 +1,8 @@ +{ + "data": { + "searchProfile": [ + { "name": "Jessie Pinkman", "age": 26 }, + { "name": "Sherlock Holmes", "age": 40 } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_6.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_6.json new file mode 100644 index 000000000..df3ea9b11 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_6.json @@ -0,0 +1,8 @@ +{ + "data": { + "searchProfile": [ + { "name": "Jessie Pinkman", "age": 26 }, + { "name": "Sherlock Holmes", "age": 40 } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_7.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_7.json new file mode 100644 index 000000000..542ea5010 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_7.json @@ -0,0 +1,9 @@ +{ + "data": { + "getSuggestions": [ + { "movieName": "Escape Plan", "director": "Mikael Hafstrom" }, + { "movieName": "Papillon", "director": "Franklin Schaffner" }, + { "movieName": "The Fugitive", "director": "Andrew Davis" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_8.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_8.json new file mode 100644 index 000000000..bc44e10a5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_8.json @@ -0,0 +1,7 @@ +{ + "data": { + "getMovie": [ + { "movieName": "Sherlock Holmes", "director": "Dexter Fletcher" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_9.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_9.json new file mode 100644 index 000000000..0e1b69eeb --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_with_variable_default_values_9.json @@ -0,0 +1,5 @@ +{ + "data": { + "isIncludeHoliday": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects.json new file mode 100644 index 000000000..e3d3eebc1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects.json @@ -0,0 +1,5 @@ +{ + "data": { + "getMovie": [{ "movieName": "El Camino", "director": "Vince Gilligan" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects_with_variables.json new file mode 100644 index 000000000..bc44e10a5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/list_type_within_input_objects_with_variables.json @@ -0,0 +1,7 @@ +{ + "data": { + "getMovie": [ + { "movieName": "Sherlock Holmes", "director": "Dexter Fletcher" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map.json new file mode 100644 index 000000000..5fe1bced7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map.json @@ -0,0 +1,9 @@ +{ + "data": { + "company": { + "workers": { + "name": "John Doe" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_invalid_key.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_invalid_key.json new file mode 100644 index 000000000..948685ea3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_invalid_key.json @@ -0,0 +1,15 @@ +{ + "errors": [ + { + "message": "The field \"name\" is a map, but it does not contain the key \"desktop\"", + "locations": [{ "line": 4, "column": 5 }], + "path": ["languages", "desktop"] + }, + { + "message": "The field \"name\" is a map, but it does not contain the key \"deployment\"", + "locations": [{ "line": 6, "column": 5 }], + "path": ["languages", "deploy"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_valid_key.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_valid_key.json new file mode 100644 index 000000000..93060dd5c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_with_valid_key.json @@ -0,0 +1,7 @@ +{ + "data": { + "languages": { + "backend": "Ballerina" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_without_key_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_without_key_input.json new file mode 100644 index 000000000..a411a0b98 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/map_without_key_input.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"workers\" argument \"key\" of type \"String!\" is required, but it was not provided.", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_directive_usage_in_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_directive_usage_in_fields.json new file mode 100644 index 000000000..4534456e7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_directive_usage_in_fields.json @@ -0,0 +1,9 @@ +{ + "data": { + "detective": { + "address": { + "street": "Baker Street" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations.json new file mode 100644 index 000000000..6ebef06d4 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations.json @@ -0,0 +1,16 @@ +{ + "data": { + "setName": { + "name": "Heisenberg", + "address": { + "city": "Albuquerque" + } + }, + "setCity": { + "name": "Heisenberg", + "address": { + "city": "New Hampshire" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations_on_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations_on_service_objects.json new file mode 100644 index 000000000..770ed8c15 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_mutations_on_service_objects.json @@ -0,0 +1,12 @@ +{ + "data": { + "setTeacherSubject": { + "subject": "Chemistry", + "name": "Walter Bishop" + }, + "setTeacherName": { + "name": "Walter White", + "subject": "Chemistry" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_variable_types_with_single_query.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_variable_types_with_single_query.json new file mode 100644 index 000000000..b7a636513 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/multiple_variable_types_with_single_query.json @@ -0,0 +1,9 @@ +{ + "data": { + "greet": "Hello, Thisaru", + "isLegal": true, + "weightInPounds": 155.45250000000001, + "isHoliday": false, + "getDay": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation.json new file mode 100644 index 000000000..1dc6e571e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation.json @@ -0,0 +1,7 @@ +{ + "data": { + "setName": { + "name": "Heisenberg" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json new file mode 100644 index 000000000..fa897f023 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Schema is not configured for mutations.", + "locations": [{ "line": 1, "column": 1 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_type_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_type_introspection.json new file mode 100644 index 000000000..c3239a1ec --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/mutation_type_introspection.json @@ -0,0 +1,15 @@ +{ + "data": { + "__schema": { + "mutationType": { + "kind": "OBJECT", + "fields": [ + { "name": "setName" }, + { "name": "setCity" }, + { "name": "setTeacherName" }, + { "name": "setTeacherSubject" } + ] + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/named_fragments_with_duplicate_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/named_fragments_with_duplicate_fields.json new file mode 100644 index 000000000..1de39528d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/named_fragments_with_duplicate_fields.json @@ -0,0 +1,32 @@ +{ + "data": { + "people": [ + { + "address": { + "city": "London", + "street": "Baker Street", + "number": "221/B" + } + }, + { + "address": { + "city": "Albuquerque", + "street": "Negra Arroyo Lane", + "number": "308" + } + }, + { + "address": { + "city": "Hogwarts", + "street": "Unknown", + "number": "Uknown" + } + } + ], + "students": [ + { "name": "John Doe" }, + { "name": "Jane Doe" }, + { "name": "Jonny Doe" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments.json new file mode 100644 index 000000000..2181e2b51 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments.json @@ -0,0 +1,21 @@ +{ + "data": { + "people": [ + { + "address": { + "city": "London" + } + }, + { + "address": { + "city": "Albuquerque" + } + }, + { + "address": { + "city": "Hogwarts" + } + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json new file mode 100644 index 000000000..d7273461d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json @@ -0,0 +1,8 @@ +{ + "data": { + "teacher": { + "name": "Walter White", + "subject": "Chemistry" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json new file mode 100644 index 000000000..9225fb9c6 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json @@ -0,0 +1,16 @@ +{ + "errors": [ + { + "message": "prices: In element #0: In element #2:Float cannot represent non Float value: d", + "locations": [{ "line": 2, "column": 28 }] + }, + { + "message": "prices: In element #1: In element #3:Float cannot represent non Float value: is", + "locations": [{ "line": 2, "column": 42 }] + }, + { + "message": "prices: In element #2: In element #4:Float cannot represent non Float value: true", + "locations": [{ "line": 2, "column": 62 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json new file mode 100644 index 000000000..429e690f8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json @@ -0,0 +1,24 @@ +{ + "errors": [ + { + "message": "prices: In element #0:[Float!]! cannot represent non [Float!]! value: 2", + "locations": [{ "line": 2, "column": 21 }] + }, + { + "message": "prices: In element #1:[Float!]! cannot represent non [Float!]! value: 3", + "locations": [{ "line": 2, "column": 24 }] + }, + { + "message": "prices: In element #2:[Float!]! cannot represent non [Float!]! value: 4", + "locations": [{ "line": 2, "column": 27 }] + }, + { + "message": "prices: In element #3:[Float!]! cannot represent non [Float!]! value: 5", + "locations": [{ "line": 2, "column": 30 }] + }, + { + "message": "prices: In element #4:[Float!]! cannot represent non [Float!]! value: 6", + "locations": [{ "line": 2, "column": 33 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map.json new file mode 100644 index 000000000..059a6f96e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map.json @@ -0,0 +1,11 @@ +{ + "data": { + "company": { + "workers": { + "contacts": { + "number": "+94771234567" + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map_without_key_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map_without_key_input.json new file mode 100644 index 000000000..83dae873b --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_map_without_key_input.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Field \"contacts\" argument \"key\" of type \"String!\" is required, but it was not provided.", + "locations": [{ "line": 4, "column": 7 }] + }, + { + "message": "Field \"contacts\" of type \"Contact!\" must have a selection of subfields. Did you mean \"contacts { ... }\"?", + "locations": [{ "line": 4, "column": 7 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_records_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_records_array.json new file mode 100644 index 000000000..f74ecff91 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nested_records_array.json @@ -0,0 +1,64 @@ +{ + "data": { + "students": [ + { + "name": "John Doe", + "courses": [ + { + "name": "Electronics", + "books": [ + { "name": "The Art of Electronics" }, + { "name": "Practical Electronics" } + ] + }, + { + "name": "Computer Science", + "books": [ + { "name": "Algorithms to Live By" }, + { "name": "Code: The Hidden Language" } + ] + } + ] + }, + { + "name": "Jane Doe", + "courses": [ + { + "name": "Computer Science", + "books": [ + { "name": "Algorithms to Live By" }, + { "name": "Code: The Hidden Language" } + ] + }, + { + "name": "Mathematics", + "books": [{ "name": "Calculus Made Easy" }, { "name": "Calculus" }] + } + ] + }, + { + "name": "Jonny Doe", + "courses": [ + { + "name": "Electronics", + "books": [ + { "name": "The Art of Electronics" }, + { "name": "Practical Electronics" } + ] + }, + { + "name": "Computer Science", + "books": [ + { "name": "Algorithms to Live By" }, + { "name": "Code: The Hidden Language" } + ] + }, + { + "name": "Mathematics", + "books": [{ "name": "Calculus Made Easy" }, { "name": "Calculus" }] + } + ] + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_list.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_list.json new file mode 100644 index 000000000..0b78e8b48 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_list.json @@ -0,0 +1,5 @@ +{ + "data": { + "cities": ["Albequerque", "Hogwarts"] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record.json new file mode 100644 index 000000000..d8177071f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record.json @@ -0,0 +1,5 @@ +{ + "data": { + "city": "Albequerque" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record_field.json new file mode 100644 index 000000000..fd991f40f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_input_for_nullable_record_field.json @@ -0,0 +1,5 @@ +{ + "data": { + "accountNumber": 123456 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json new file mode 100644 index 000000000..d5912aefa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json @@ -0,0 +1,15 @@ +{ + "data": { + "getSuggestions": [ + { + "movieName": "Harry Potter and the Sorcerer's Stone", + "director": "Chris Columbus" + }, + { "movieName": "Sherlock Holmes", "director": "Dexter Fletcher" }, + { "movieName": "El Camino", "director": "Vince Gilligan" }, + { "movieName": "Escape Plan", "director": "Mikael Hafstrom" }, + { "movieName": "Papillon", "director": "Franklin Schaffner" }, + { "movieName": "The Fugitive", "director": "Andrew Davis" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json new file mode 100644 index 000000000..d5912aefa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json @@ -0,0 +1,15 @@ +{ + "data": { + "getSuggestions": [ + { + "movieName": "Harry Potter and the Sorcerer's Stone", + "director": "Chris Columbus" + }, + { "movieName": "Sherlock Holmes", "director": "Dexter Fletcher" }, + { "movieName": "El Camino", "director": "Vince Gilligan" }, + { "movieName": "Escape Plan", "director": "Mikael Hafstrom" }, + { "movieName": "Papillon", "director": "Franklin Schaffner" }, + { "movieName": "The Fugitive", "director": "Andrew Davis" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input_with_variable_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input_with_variable_value.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_enum_input_with_variable_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_resource_function_name.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_resource_function_name.json new file mode 100644 index 000000000..f471d9f15 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_resource_function_name.json @@ -0,0 +1,5 @@ +{ + "data": { + "null": null + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input.json new file mode 100644 index 000000000..f126cca60 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input.json @@ -0,0 +1,7 @@ +{ + "data": { + "profile": { + "name": "Sherlock Holmes" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json new file mode 100644 index 000000000..f126cca60 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json @@ -0,0 +1,7 @@ +{ + "data": { + "profile": { + "name": "Sherlock Holmes" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_input_for_nullable_record_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_input_for_nullable_record_field.json new file mode 100644 index 000000000..fd991f40f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_input_for_nullable_record_field.json @@ -0,0 +1,5 @@ +{ + "data": { + "accountNumber": 123456 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments.json new file mode 100644 index 000000000..f126cca60 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments.json @@ -0,0 +1,7 @@ +{ + "data": { + "profile": { + "name": "Sherlock Holmes" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json new file mode 100644 index 000000000..f126cca60 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json @@ -0,0 +1,7 @@ +{ + "data": { + "profile": { + "name": "Sherlock Holmes" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument.json new file mode 100644 index 000000000..f46d178a8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Expected value of type \"String!\", found null.", + "locations": [{ "line": 2, "column": 15 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json new file mode 100644 index 000000000..dd83560d9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Variable name expected value of type \"String!\", found null", + "locations": [{ "line": 2, "column": 18 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json new file mode 100644 index 000000000..fca088366 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Data not found", + "locations": [{ "line": 2, "column": 3 }], + "path": ["name"] + } + ], + "data": { + "name": null + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json new file mode 100644 index 000000000..433cb9c78 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json @@ -0,0 +1,7 @@ +{ + "data": { + "book": { + "name": "Algorithms to Live By" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json new file mode 100644 index 000000000..9f299a7c1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Word list is empty" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field.json new file mode 100644 index 000000000..d27e96049 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field.json @@ -0,0 +1,7 @@ +{ + "data": { + "book": { + "name": "The Art of Electronics" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json new file mode 100644 index 000000000..d27e96049 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json @@ -0,0 +1,7 @@ +{ + "data": { + "book": { + "name": "The Art of Electronics" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json new file mode 100644 index 000000000..1cbca7019 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Hello! GraphQL" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_list.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_list.json new file mode 100644 index 000000000..9888e1e29 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_list.json @@ -0,0 +1,5 @@ +{ + "data": { + "cities": null + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_record.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_record.json new file mode 100644 index 000000000..7b31b5c9d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_input_for_nullable_record.json @@ -0,0 +1,5 @@ +{ + "data": { + "city": null + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json new file mode 100644 index 000000000..26bb8b6c6 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json @@ -0,0 +1,16 @@ +{ + "errors": [ + { + "message": "words: In element #1:String cannot represent non String value: 5", + "locations": [{ "line": 2, "column": 28 }] + }, + { + "message": "words: In element #2:String cannot represent non String value: true", + "locations": [{ "line": 2, "column": 31 }] + }, + { + "message": "words: In element #3:String cannot represent non String value: {}", + "locations": [{ "line": 2, "column": 37 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_without_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_without_value.json new file mode 100644 index 000000000..9f299a7c1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_list_type_input_without_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "concat": "Word list is empty" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json new file mode 100644 index 000000000..89376608c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json @@ -0,0 +1,5 @@ +{ + "data": { + "services": [{}, { "name": "Walter White" }, null] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_variables_without_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_variables_without_value.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/nullable_variables_without_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_arrays_with_invalid_query.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_arrays_with_invalid_query.json new file mode 100644 index 000000000..341d6cab9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_arrays_with_invalid_query.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"searchVehicles\" of type \"[Vehicle!]\" must have a selection of subfields. Did you mean \"searchVehicles { ... }\"?", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_with_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_with_value.json new file mode 100644 index 000000000..a1ccd8632 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_with_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": true + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_without_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_without_value.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/optional_enum_argument_without_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter.json new file mode 100644 index 000000000..73843c3ad --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter.json @@ -0,0 +1,8 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "age": 52 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter_reference.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter_reference.json new file mode 100644 index 000000000..7991ace36 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_paramenter_reference.json @@ -0,0 +1,8 @@ +{ + "data": { + "book": { + "name": "Nineteen Eighty-Four", + "author": "George Orwell" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_array.json new file mode 100644 index 000000000..64c39912e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_array.json @@ -0,0 +1,8 @@ +{ + "data": { + "profiles": [ + { "name": "Walter White", "age": 52 }, + { "name": "Jesse Pinkman", "age": 25 } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json new file mode 100644 index 000000000..61a84ff25 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json @@ -0,0 +1,8 @@ +{ + "data": { + "books": [ + { "name": "Nineteen Eighty-Four", "author": "George Orwell" }, + { "name": "The Magic of Reality", "author": "Richard Dawkins" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_type_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_type_introspection.json new file mode 100644 index 000000000..f85c2ec11 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_type_introspection.json @@ -0,0 +1,17 @@ +{ + "data": { + "__schema": { + "queryType": { + "kind": "OBJECT", + "fields": [ + { "name": "detective" }, + { "name": "teacher" }, + { "name": "student" }, + { "name": "profile" }, + { "name": "people" }, + { "name": "students" } + ] + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_with_default_parameter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_with_default_parameter.json new file mode 100644 index 000000000..d1a13a739 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_with_default_parameter.json @@ -0,0 +1,5 @@ +{ + "data": { + "quoteById": "I can make them hurt if I want to!" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_without_default_parameter.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_without_default_parameter.json new file mode 100644 index 000000000..5c92d92e5 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/query_without_default_parameter.json @@ -0,0 +1,5 @@ +{ + "data": { + "quoteById": "I am a high-functioning sociapath!" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_subfields_on_type_name.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_subfields_on_type_name.json new file mode 100644 index 000000000..f305a939e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_subfields_on_type_name.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"__typename\" must not have a selection since type \"String!\" has no subfields.", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_table_without_selections.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_table_without_selections.json new file mode 100644 index 000000000..dc91ca8ef --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/querying_table_without_selections.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"employees\" of type \"[Employee!]\" must have a selection of subfields. Did you mean \"employees { ... }\"?", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/record_type_arrays.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/record_type_arrays.json new file mode 100644 index 000000000..7724d20be --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/record_type_arrays.json @@ -0,0 +1,24 @@ +{ + "data": { + "people": [ + { + "name": "Sherlock Holmes", + "address": { + "city": "London" + } + }, + { + "name": "Walter White", + "address": { + "city": "Albuquerque" + } + }, + { + "name": "Tom Marvolo Riddle", + "address": { + "city": "Hogwarts" + } + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field.json new file mode 100644 index 000000000..189deb67d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"status\" on type \"Person\".", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field_from_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field_from_service_objects.json new file mode 100644 index 000000000..cc204b95c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/request_invalid_field_from_service_objects.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"invalid\" on type \"Lift\".", + "locations": [{ "line": 5, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/requesting_object_without_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/requesting_object_without_fields.json new file mode 100644 index 000000000..5ff8c9fba --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/requesting_object_without_fields.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"profile\" of type \"Person!\" must have a selection of subfields. Did you mean \"profile { ... }\"?", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json new file mode 100644 index 000000000..fe6f58066 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json @@ -0,0 +1,24 @@ +{ + "data": { + "top3": [ + { + "product": { + "id": "1" + }, + "score": 20 + }, + { + "product": { + "id": "2" + }, + "score": 20 + }, + { + "product": { + "id": "3" + }, + "score": 20 + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_map_of_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_map_of_service_objects.json new file mode 100644 index 000000000..35dc82624 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_map_of_service_objects.json @@ -0,0 +1,9 @@ +{ + "data": { + "account": { + "details": { + "name": "James" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json new file mode 100644 index 000000000..c3395c91d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json @@ -0,0 +1,36 @@ +{ + "data": { + "all": [ + { + "product": { + "id": "1" + }, + "score": 20 + }, + { + "product": { + "id": "2" + }, + "score": 20 + }, + { + "product": { + "id": "3" + }, + "score": 20 + }, + { + "product": { + "id": "4" + }, + "score": 20 + }, + { + "product": { + "id": "5" + }, + "score": 20 + } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables.json new file mode 100644 index 000000000..9caa9c2a0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables.json @@ -0,0 +1,5 @@ +{ + "data": { + "all": [{ "isoCode": "AFG" }, { "isoCode": "SL" }, { "isoCode": "US" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables_with_errors.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables_with_errors.json new file mode 100644 index 000000000..7c087e60c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resolver_returning_tables_with_errors.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Undefined task!", + "locations": [{ "line": 3, "column": 5 }], + "path": ["tasks", "subTasks", 1] + } + ], + "data": { + "tasks": [{ "subTasks": null }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_arrays_missing_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_arrays_missing_fields.json new file mode 100644 index 000000000..aa97363db --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_arrays_missing_fields.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"people\" of type \"[Person!]!\" must have a selection of subfields. Did you mean \"people { ... }\"?", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json new file mode 100644 index 000000000..d5e41bbb8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json @@ -0,0 +1,5 @@ +{ + "data": { + "searchVehicles": [{ "id": "V1" }, { "id": "V2" }, { "id": "V3" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object.json new file mode 100644 index 000000000..941423dea --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object.json @@ -0,0 +1,7 @@ +{ + "data": { + "greet": { + "generalGreeting": "Hello, world" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object_array.json new file mode 100644 index 000000000..3dda20898 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_service_object_array.json @@ -0,0 +1,5 @@ +{ + "data": { + "allVehicles": [{ "name": "Benz" }, { "name": "BMW" }, { "name": "Ford" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_tables.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_tables.json new file mode 100644 index 000000000..00bc920cc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/resource_returning_tables.json @@ -0,0 +1,9 @@ +{ + "data": { + "employees": [ + { "name": "John Doe" }, + { "name": "Jane Doe" }, + { "name": "Johnny Roe" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array.json new file mode 100644 index 000000000..d363602b7 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array.json @@ -0,0 +1,5 @@ +{ + "data": { + "holidays": ["SATURDAY", "SUNDAY"] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array_with_errors.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array_with_errors.json new file mode 100644 index 000000000..9abe16540 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_enum_array_with_errors.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Holiday!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["openingDays", 2] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json new file mode 100644 index 000000000..00dcc34cc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Holiday!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["specialHolidays", 1] + } + ], + "data": { + "specialHolidays": ["TUESDAY", null, "THURSDAY"] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_recursive_service_type.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_recursive_service_type.json new file mode 100644 index 000000000..10fefecaa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_recursive_service_type.json @@ -0,0 +1,7 @@ +{ + "data": { + "trail": { + "name": "Blue Bird" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_union_of_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_union_of_service_objects.json new file mode 100644 index 000000000..075d9efd0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/returning_union_of_service_objects.json @@ -0,0 +1,9 @@ +{ + "data": { + "search": [ + { "name": "Blue Bird" }, + { "name": "Blackhawk" }, + { "name": "Astra Express" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias.json new file mode 100644 index 000000000..b02715e70 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias.json @@ -0,0 +1,16 @@ +{ + "data": { + "sherlock": { + "name": "Sherlock Holmes", + "residence": { + "hometown": "London" + } + }, + "walter": { + "name": "Walter White", + "residence": { + "hometown": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json new file mode 100644 index 000000000..83a0203ac --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json @@ -0,0 +1,16 @@ +{ + "data": { + "sherlock": { + "name": "Sherlock Holmes", + "residence": { + "apartment": "221/B" + } + }, + "walter": { + "name": "Walter White", + "residence": { + "hometown": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays.json new file mode 100644 index 000000000..b0eb40b85 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays.json @@ -0,0 +1,5 @@ +{ + "data": { + "ids": [0, 1, 2] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays_with_errors.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays_with_errors.json new file mode 100644 index 000000000..433d326e9 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_arrays_with_errors.json @@ -0,0 +1,10 @@ +{ + "errors": [ + { + "message": "Not Found!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["idsWithErrors", 3] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json new file mode 100644 index 000000000..fbeb13778 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json @@ -0,0 +1,12 @@ +{ + "errors": [ + { + "message": "Not Found!", + "locations": [{ "line": 2, "column": 3 }], + "path": ["friends", 2] + } + ], + "data": { + "friends": ["walter", "jessie", null] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json new file mode 100644 index 000000000..b500dc769 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json @@ -0,0 +1,16 @@ +{ + "errors": [ + { + "message": "Registered Year is Not Found", + "locations": [{ "line": 9, "column": 3 }], + "path": ["allVehicles", 2, "registeredYear"] + } + ], + "data": { + "allVehicles": [ + { "name": "Benz", "registeredYear": 2005 }, + { "name": "BMW", "registeredYear": 2010 }, + { "name": "Ford", "registeredYear": null } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_invalid_response_order.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_invalid_response_order.json new file mode 100644 index 000000000..64ed14427 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_array_with_invalid_response_order.json @@ -0,0 +1,16 @@ +{ + "data": { + "allVehicles": [ + { "name": "Benz", "registeredYear": 2005 }, + { "name": "BMW", "registeredYear": 2010 }, + { "name": "Ford", "registeredYear": null } + ] + }, + "errors": [ + { + "message": "Registered Year is Not Found", + "locations": [{ "line": 9, "column": 3 }], + "path": ["allVehicles", 2, "registeredYear"] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_defined_as_record_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_defined_as_record_field.json new file mode 100644 index 000000000..9678886d3 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_object_defined_as_record_field.json @@ -0,0 +1,10 @@ +{ + "data": { + "latest": { + "product": { + "id": "5" + }, + "score": 20 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_with_other_annotations.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_with_other_annotations.json new file mode 100644 index 000000000..ed33dc5ae --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/service_with_other_annotations.json @@ -0,0 +1,5 @@ +{ + "data": { + "greeting": "Hello" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_quering_on_interface.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_quering_on_interface.json new file mode 100644 index 000000000..65e7fa6fc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_quering_on_interface.json @@ -0,0 +1,8 @@ +{ + "data": { + "animal": { + "name": "WALTER", + "sex": "male" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json new file mode 100644 index 000000000..a656e04dc --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json @@ -0,0 +1,22 @@ +{ + "data": { + "thisIsAMule": { + "name": "LARA", + "sex": "female", + "father": { + "__typename": "Donkey", + "name": "RUDY", + "id": 5 + }, + "isAggressive": false + }, + "thisIsAHorse": { + "name": "WALTER", + "sex": "male", + "father": { + "__typename": "Horse", + "name": "WALTER" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type.json new file mode 100644 index 000000000..a75251f1c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type.json @@ -0,0 +1,7 @@ +{ + "data": { + "animal": { + "isAggressive": false + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json new file mode 100644 index 000000000..9f50c5884 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json @@ -0,0 +1,9 @@ +{ + "data": { + "animal": { + "name": "LARA", + "sex": "female", + "isAggressive": false + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection.json new file mode 100644 index 000000000..dd18ac9ab --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection.json @@ -0,0 +1,8 @@ +{ + "data": { + "__type": { + "kind": "OBJECT", + "fields": [{ "name": "name" }, { "name": "age" }, { "name": "address" }] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_in_invalid_place.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_in_invalid_place.json new file mode 100644 index 000000000..483931e01 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_in_invalid_place.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"__type\" on type \"Person\".", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_on_non_existing_type.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_on_non_existing_type.json new file mode 100644 index 000000000..5d3b07aa2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_on_non_existing_type.json @@ -0,0 +1,5 @@ +{ + "data": { + "__type": null + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_with_alias.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_with_alias.json new file mode 100644 index 000000000..daa8a3654 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_with_alias.json @@ -0,0 +1,8 @@ +{ + "data": { + "FieldType": { + "name": "__Field", + "kind": "OBJECT" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_fields.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_fields.json new file mode 100644 index 000000000..fbbb35c8d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_fields.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"__type\" of type \"__Type\" must have a selection of subfields. Did you mean \"__type { ... }\"?", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_type_name_argument.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_type_name_argument.json new file mode 100644 index 000000000..3074cd80f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_introspection_without_type_name_argument.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"__type\" argument \"name\" of type \"String!\" is required, but it was not provided.", + "locations": [{ "line": 2, "column": 3 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_in_fragments.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_in_fragments.json new file mode 100644 index 000000000..91388034c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_in_fragments.json @@ -0,0 +1,8 @@ +{ + "data": { + "search": [ + { "__typename": "StudentService", "name": "Jesse Pinkman" }, + { "subject": "Chemistry" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json new file mode 100644 index 000000000..1a065d83c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json @@ -0,0 +1,9 @@ +{ + "data": { + "services": [ + { "__typename": "StudentService", "name": "Jesse Pinkman" }, + { "__typename": "TeacherService", "subject": "Chemistry" }, + null + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_operation.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_operation.json new file mode 100644 index 000000000..b1b150a5c --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_operation.json @@ -0,0 +1,5 @@ +{ + "data": { + "__typename": "Query" + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_record_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_record_types.json new file mode 100644 index 000000000..36fda8309 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_record_types.json @@ -0,0 +1,7 @@ +{ + "data": { + "detective": { + "__typename": "Person" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_service_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_service_types.json new file mode 100644 index 000000000..b4cf8a773 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_service_types.json @@ -0,0 +1,8 @@ +{ + "data": { + "teacher": { + "name": "Walter White", + "__typename": "TeacherService" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json new file mode 100644 index 000000000..221051cbd --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json @@ -0,0 +1,8 @@ +{ + "data": { + "search": [ + { "__typename": "StudentService", "name": "Jesse Pinkman" }, + { "__typename": "TeacherService", "subject": "Chemistry" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_field.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_field.json new file mode 100644 index 000000000..0b7858039 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_field.json @@ -0,0 +1,12 @@ +{ + "data": { + "__type": { + "name": "Person", + "fields": [ + { "name": "name", "__typename": "__Field" }, + { "name": "age", "__typename": "__Field" }, + { "name": "address", "__typename": "__Field" } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_scalar.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_scalar.json new file mode 100644 index 000000000..84f9bf455 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_scalar.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Field \"name\" must not have a selection since type \"String!\" has no subfields.", + "locations": [{ "line": 3, "column": 5 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_schema_introspection.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_schema_introspection.json new file mode 100644 index 000000000..9a3e9a425 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_schema_introspection.json @@ -0,0 +1,25 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "__Field", "__typename": "__Type" }, + { "name": "__TypeKind", "__typename": "__Type" }, + { "name": "Query", "__typename": "__Type" }, + { "name": "Address", "__typename": "__Type" }, + { "name": "__Schema", "__typename": "__Type" }, + { "name": "__Type", "__typename": "__Type" }, + { "name": "__EnumValue", "__typename": "__Type" }, + { "name": "__DirectiveLocation", "__typename": "__Type" }, + { "name": "String", "__typename": "__Type" }, + { "name": "Student", "__typename": "__Type" }, + { "name": "Int", "__typename": "__Type" }, + { "name": "Book", "__typename": "__Type" }, + { "name": "__InputValue", "__typename": "__Type" }, + { "name": "Course", "__typename": "__Type" }, + { "name": "Boolean", "__typename": "__Type" }, + { "name": "Person", "__typename": "__Type" }, + { "name": "__Directive", "__typename": "__Type" } + ] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_type_record.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_type_record.json new file mode 100644 index 000000000..005cf4ad8 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/typename_introspection_on_type_record.json @@ -0,0 +1,7 @@ +{ + "data": { + "__type": { + "__typename": "__Type" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_service_objects.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_service_objects.json new file mode 100644 index 000000000..360691480 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_service_objects.json @@ -0,0 +1,8 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "subject": "Chemistry" + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json new file mode 100644 index 000000000..2dc8cf376 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json @@ -0,0 +1,5 @@ +{ + "data": { + "search": [{}, { "name": "Walter White" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json new file mode 100644 index 000000000..2dc8cf376 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json @@ -0,0 +1,5 @@ +{ + "data": { + "search": [{}, { "name": "Walter White" }] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json new file mode 100644 index 000000000..eff38422a --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json @@ -0,0 +1,5 @@ +{ + "data": { + "profile": {} + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_type_names.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_type_names.json new file mode 100644 index 000000000..45e21c6aa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_type_names.json @@ -0,0 +1,120 @@ +{ + "data": { + "__schema": { + "queryType": { + "fields": [ + { + "name": "nonNullSingleObject", + "type": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": "PeopleService", + "kind": "UNION", + "ofType": null + } + } + }, + { + "name": "nullableSingleObject", + "type": { + "name": "PeopleService", + "kind": "UNION", + "ofType": null + } + }, + { + "name": "nonNullArray", + "type": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": null, + "kind": "LIST", + "ofType": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": "PeopleService", + "kind": "UNION" + } + } + } + } + }, + { + "name": "nullableArray", + "type": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": null, + "kind": "LIST", + "ofType": { + "name": "PeopleService", + "kind": "UNION", + "ofType": null + } + } + } + }, + { + "name": "nonNullUndefinedUnionType", + "type": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": "StudentService_TeacherService", + "kind": "UNION", + "ofType": null + } + } + }, + { + "name": "nonNullUndefinedUnionTypeArray", + "type": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": null, + "kind": "LIST", + "ofType": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": "StudentService_TeacherService", + "kind": "UNION" + } + } + } + } + }, + { + "name": "nullableUndefinedUnionType", + "type": { + "name": "StudentService_TeacherService", + "kind": "UNION", + "ofType": null + } + }, + { + "name": "nullableUndefinedUnionTypeArray", + "type": { + "name": null, + "kind": "NON_NULL", + "ofType": { + "name": null, + "kind": "LIST", + "ofType": { + "name": "StudentService_TeacherService", + "kind": "UNION", + "ofType": null + } + } + } + } + ] + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_field_returning_enum.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_field_returning_enum.json new file mode 100644 index 000000000..1597995c0 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_field_returning_enum.json @@ -0,0 +1,8 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "holidays": ["SATURDAY", "SUNDAY"] + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json new file mode 100644 index 000000000..21b4c4720 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json @@ -0,0 +1,11 @@ +{ + "data": { + "profile": { + "holidays": ["SATURDAY", "SUNDAY"], + "school": { + "name": "CHEM", + "openingDays": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"] + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/unknown_inline_fragment.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/unknown_inline_fragment.json new file mode 100644 index 000000000..6319ded56 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/unknown_inline_fragment.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Unknown type \"on\".", + "locations": [{ "line": 2, "column": 10 }] + } + ] +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json new file mode 100644 index 000000000..76aa67826 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 8.82 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_inside_list_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_inside_list_value.json new file mode 100644 index 000000000..401b3d559 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_inside_list_value.json @@ -0,0 +1,9 @@ +{ + "data": { + "getSuggestions": [ + { "movieName": "Escape Plan" }, + { "movieName": "Papillon" }, + { "movieName": "The Fugitive" } + ] + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json new file mode 100644 index 000000000..34497a06d --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json @@ -0,0 +1,5 @@ +{ + "data": { + "weightInPounds": 2.205 + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_null_value.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_null_value.json new file mode 100644 index 000000000..44e1e441f --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_null_value.json @@ -0,0 +1,5 @@ +{ + "data": { + "isHoliday": false + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_values.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_values.json new file mode 100644 index 000000000..206874bfa --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_default_values.json @@ -0,0 +1,9 @@ +{ + "data": { + "profile": { + "address": { + "city": "Albuquerque" + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_multiple_operations.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_multiple_operations.json new file mode 100644 index 000000000..a6b0ed0e1 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_multiple_operations.json @@ -0,0 +1,8 @@ +{ + "data": { + "profile": { + "name": "Walter White", + "age": 50 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_nested_map.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_nested_map.json new file mode 100644 index 000000000..059a6f96e --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_nested_map.json @@ -0,0 +1,11 @@ +{ + "data": { + "company": { + "workers": { + "contacts": { + "number": "+94771234567" + } + } + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_query_and_mutation.json b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_query_and_mutation.json new file mode 100644 index 000000000..ef31b1963 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/resources/expected_results/variables_with_query_and_mutation.json @@ -0,0 +1,8 @@ +{ + "data": { + "addShape": { + "name": "Cube", + "edges": 12 + } + } +} diff --git a/ballerina-tests/graphql-service-test-suite/tests/services.bal b/ballerina-tests/graphql-service-test-suite/tests/services.bal new file mode 100644 index 000000000..6cc10d0f2 --- /dev/null +++ b/ballerina-tests/graphql-service-test-suite/tests/services.bal @@ -0,0 +1,1446 @@ +// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/lang.runtime; +import ballerina/uuid; + +graphql:Service graphiqlDefaultPathConfigService = +@graphql:ServiceConfig { + graphiql: { + enabled: true + } +} +service object { + isolated resource function get greet() returns string { + return "Hello"; + } +}; + +graphql:Service graphiqlConfigService = +@graphql:ServiceConfig { + graphiql: { + enabled: true, + path: "ballerina/graphiql" + } +} +service object { + isolated resource function get greet() returns string { + return "Hello"; + } +}; + +@graphql:ServiceConfig { + graphiql: { + enabled: true + } +} +service /graphiql/test on basicListener { + isolated resource function get greet() returns string { + return "Hello"; + } +} + +@graphql:ServiceConfig { + graphiql: { + enabled: true, + path: "ballerina/graphiql" + } +} +service on basicListener { + isolated resource function get greet() returns string { + return "Hello"; + } +} + +@graphql:ServiceConfig { + graphiql: { + enabled: true + } +} +service on serviceTypeListener { + isolated resource function get greet() returns string { + return "Hello"; + } +} + +@graphql:ServiceConfig { + graphiql: { + enabled: true, + path: "graphiql/interface" + } +} +service /graphiqlClient on basicListener { + isolated resource function get greet() returns string { + return "Hello"; + } +} + +const float CONVERSION_KG_TO_LBS = 2.205; + +service /inputs on basicListener { + isolated resource function get greet(string name) returns string { + return "Hello, " + name; + } + + isolated resource function get name(string name = "Walter") returns string { + return name; + } + + isolated resource function get isLegal(int age) returns boolean { + if age < 21 { + return false; + } + return true; + } + + isolated resource function get quoteById(int id = 0) returns string? { + match id { + 0 => { + return quote1; + } + 1 => { + return quote2; + } + 2 => { + return quote3; + } + } + return; + } + + isolated resource function get weightInPounds(float weightInKg) returns float { + return weightInKg * CONVERSION_KG_TO_LBS; + } + + isolated resource function get isHoliday(Weekday? weekday) returns boolean { + if weekday == SUNDAY || weekday == SATURDAY { + return true; + } + return false; + } + + isolated resource function get getDay(boolean isHoliday) returns Weekday[] { + if isHoliday { + return [SUNDAY, SATURDAY]; + } + return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; + } + + isolated resource function get sendEmail(string message) returns string { + return message; + } + + isolated resource function get 'type(string 'version) returns string { + return 'version; + } + + isolated resource function get \u{0076}ersion(string name) returns string { + return name; + } + + isolated resource function get convertDecimalToFloat(decimal value) returns float|error { + return float:fromString(value.toString()); + } + + isolated resource function get getTotalInDecimal(decimal[][] prices) returns decimal[] { + decimal[] total = []; + decimal sumOfNestedList = 0; + foreach decimal[] nested in prices { + sumOfNestedList = 0; + foreach decimal price in nested { + sumOfNestedList += price; + } + total.push(sumOfNestedList); + } + return total; + } + + isolated resource function get getSubTotal(Item[] items) returns decimal { + decimal subTotal = 0.0; + foreach Item item in items { + subTotal += item.price; + } + return subTotal; + } +} + +service /input_objects on basicListener { + isolated resource function get searchProfile(ProfileDetail profileDetail) returns Person { + if profileDetail?.age == 28 && profileDetail.name == "Jessie" { + return { + name: "Jessie Pinkman", + age: 26, + address: {number: "23B", street: "Negra Arroyo Lane", city: "Albuquerque"} + }; + } else if profileDetail?.age == 30 || profileDetail.name == "Walter" { + return { + name: "Walter White", + age: 50, + address: {number: "9809", street: "Margo Street", city: "Albuquerque"} + }; + } else { + return { + name: "Sherlock Holmes", + age: 40, + address: {number: "221/B", street: "Baker Street", city: "London"} + }; + } + } + + isolated resource function get book(Info info) returns Book[] { + if info.author.name == "Conan Doyle" { + return [b7, b8]; + } else if info.bookName == "Harry Potter" { + return [b9, b10]; + } else if info.author.name == "J.K Rowling" { + return [b9, b10]; + } else if info?.movie?.movieName == "Harry Potter" { + return [b9, b10]; + } else if info?.movie?.director == "Chris Columbus" || info?.movie?.director == "Dexter Fletcher" { + return [b7, b8, b9, b10]; + } else { + return [b7, b8, b9, b10]; + } + } + + isolated resource function get isHoliday(Date date) returns boolean { + if date.day == SUNDAY || date.day == SATURDAY { + return true; + } + return false; + } + + isolated resource function get weightInPounds(Weight weight) returns float { + return weight.weightInKg * CONVERSION_KG_TO_LBS; + } + + isolated resource function get convertKgToGram(WeightInKg weight) returns float { + return weight.weight * 1000.00; + } + + isolated resource function get name(DefaultPerson person) returns string { + return person.name; + } +} + +service /list_inputs on basicListener { + isolated resource function get concat(string?[]? words) returns string { + string result = ""; + if words is string?[] && words.length() > 0 { + foreach string? word in words { + if word is string { + result += word; + result += " "; + } + } + return result.trim(); + } + return "Word list is empty"; + } + + isolated resource function get getTotal(float[][] prices) returns float[] { + float[] total = []; + float sumOfNestedList = 0; + foreach float[] nested in prices { + sumOfNestedList = 0; + foreach float price in nested { + sumOfNestedList += price; + } + total.push(sumOfNestedList); + } + return total; + } + + isolated resource function get searchProfile(ProfileDetail[] profileDetail) returns Person[] { + Person[] results = []; + foreach ProfileDetail profile in profileDetail { + if profile?.age == 28 && profile.name == "Jessie" { + results.push({ + name: "Jessie Pinkman", + age: 26, + address: {number: "23B", street: "Negra Arroyo Lane", city: "Albuquerque"} + }); + } else if profile?.age == 30 || profile.name == "Walter" { + results.push({ + name: "Walter White", + age: 50, + address: {number: "9809", street: "Margo Street", city: "Albuquerque"} + }); + } else { + results.push({ + name: "Sherlock Holmes", + age: 40, + address: {number: "221/B", street: "Baker Street", city: "London"} + }); + } + } + return results; + } + + resource function get getSuggestions(TvSeries[] tvSeries) returns Movie[] { + Movie[] results = [m1, m2, m3, m4, m5, m6]; + foreach TvSeries item in tvSeries { + if item.name == "Breaking Bad" { + results = [m3]; + } else if item.name == "Prison Break" { + results = [m4, m5, m6]; + } else if item?.episodes is Episode[] { + Episode[] episodes = item?.episodes; + foreach Episode epi in episodes { + if epi?.newCharacters is string[] { + string[] characters = epi?.newCharacters; + foreach string name in characters { + if name == "Sara" || name == "Michael" || name == "Lincoln" { + results = [m4, m5, m6]; + } + } + } + } + } + } + return results; + } + + resource function get getMovie(TvSeries tvSeries) returns Movie[] { + Movie[] results = [m1, m2, m3, m4, m5, m6]; + if tvSeries?.episodes is Episode[] { + Episode[] episodes = tvSeries?.episodes; + foreach Episode episode in episodes { + if episode?.newCharacters is string[] { + string[] characters = episode?.newCharacters; + foreach string name in characters { + if name == "Sara" || name == "Michael" || name == "Lincoln" { + results = [m4, m5, m6]; + } else if name == "Harry" || name == "Hagrid" { + results = [m1]; + } else if name == "Sherlock" { + results = [m2]; + } + } + } else { + if episode.title == "The Key" || episode.title == "Flight" { + results = [m4, m5]; + } else if episode.title == "Cancer Man" { + results = [m3]; + } + } + } + } + return results; + } + + isolated resource function get isIncludeHoliday(Weekday[] days = [MONDAY, FRIDAY]) returns boolean { + if days.indexOf(SUNDAY) != () || days.indexOf(SATURDAY) != () { + return true; + } + return false; + } +} + +service /records on basicListener { + isolated resource function get detective() returns Person { + return { + name: "Sherlock Holmes", + age: 40, + address: {number: "221/B", street: "Baker Street", city: "London"} + }; + } + + isolated resource function get teacher() returns Person { + return { + name: "Walter White", + age: 50, + address: {number: "308", street: "Negra Arroyo Lane", city: "Albuquerque"} + }; + } + + isolated resource function get student() returns Person { + return { + name: "Jesse Pinkman", + age: 25, + address: {number: "9809", street: "Margo Street", city: "Albuquerque"} + }; + } + + resource function get profile(int id) returns Person|error { + return trap people[id]; + } + + resource function get people() returns Person[] { + return people; + } + + resource function get students() returns Student[] { + return students; + } +} + +service /service_types on serviceTypeListener { + isolated resource function get greet() returns GeneralGreeting { + return new; + } + + isolated resource function get profile() returns Profile { + return new; + } + + isolated resource function get person(graphql:Field 'field) returns Person { + string[] subfieldNames = 'field.getSubfieldNames(); + if subfieldNames == ["name"] { + return { + name: "Sherlock Holmes", + address: {number: "221/B", street: "Baker Street", city: "London"} + }; + } else if subfieldNames == ["name", "age"] { + return { + name: "Walter White", + age: 50, + address: {number: "309", street: "Negro Arroyo Lane", city: "Albuquerque"} + }; + } + return { + name: "Jesse Pinkman", + age: 25, + address: {number: "208", street: "Margo Street", city: "Albuquerque"} + }; + } +} + +service /service_objects on serviceTypeListener { + isolated resource function get ids() returns int[] { + return [0, 1, 2]; + } + + isolated resource function get allVehicles() returns Vehicle[] { + Vehicle v1 = new ("V1", "Benz", 2005); + Vehicle v2 = new ("V2", "BMW", 2010); + Vehicle v3 = new ("V3", "Ford"); + return [v1, v2, v3]; + } + + isolated resource function get searchVehicles(string keyword) returns Vehicle[]? { + Vehicle v1 = new ("V1", "Benz"); + Vehicle v2 = new ("V2", "BMW"); + Vehicle v3 = new ("V3", "Ford"); + return [v1, v2, v3]; + } + + isolated resource function get teacher() returns TeacherService { + return new TeacherService(737, "Walter White", "Chemistry"); + } + + isolated resource function get student(string name, graphql:Context context, int id, + graphql:Field 'field) returns StudentService { + if context.get("scope") is error { + // ignore + } + if 'field.getSubfieldNames().indexOf("id") is int { + return new StudentService(id, name); + } + return new StudentService(10, "Jesse Pinkman"); + } +} + +service /timeoutService on timeoutListener { + isolated resource function get greet() returns string { + runtime:sleep(3); + return "Hello"; + } +} + +@graphql:ServiceConfig { + cors: { + allowOrigins: ["*"], + allowCredentials: true, + allowHeaders: ["X-Content-Type-Options"], + exposeHeaders: ["X-CUSTOM-HEADER"], + allowMethods: ["*"], + maxAge: 84900 + } +} +service /corsConfigService1 on basicListener { + isolated resource function get greet() returns string { + return "Hello"; + } +} + +@graphql:ServiceConfig { + cors: { + allowOrigins: ["http://www.wso2.com"], + allowCredentials: true, + allowHeaders: ["X-Content-Type-Options", "X-PINGOTHER"], + exposeHeaders: ["X-HEADER"], + allowMethods: ["POST"] + } +} +service /corsConfigService2 on basicListener { + isolated resource function get greet() returns string { + return "Hello"; + } +} + +service /profiles on hierarchicalPathListener { + isolated resource function get profile/name/first() returns string { + return "Sherlock"; + } + + isolated resource function get profile/name/last() returns string { + return "Holmes"; + } + + isolated resource function get profile/age() returns int { + return 40; + } + + isolated resource function get profile/address/city() returns string { + return "London"; + } + + isolated resource function get profile/address/street() returns string { + return "Baker Street"; + } + + isolated resource function get profile/name/address/number() returns string { + return "221/B"; + } +} + +service /snowtooth on hierarchicalPathListener { + isolated resource function get lift/name() returns string { + return "Lift1"; + } + + isolated resource function get mountain/trail/getLift/name() returns string { + return "Lift2"; + } +} + +service /hierarchical on hierarchicalPathListener { + isolated resource function get profile/personal() returns HierarchicalName { + return new (); + } +} + +service /tables on basicListener { + resource function get employees() returns EmployeeTable? { + return employees; + } + + resource function get tasks() returns TaskTable { + return tasks; + } +} + +service /special_types on wrappedListener { + isolated resource function get weekday(int number) returns Weekday { + match number { + 1 => { + return MONDAY; + } + 2 => { + return TUESDAY; + } + 3 => { + return WEDNESDAY; + } + 4 => { + return THURSDAY; + } + 5 => { + return FRIDAY; + } + 6 => { + return SATURDAY; + } + } + return SUNDAY; + } + + isolated resource function get day(int number) returns Weekday|error { + if number < 1 || number > 7 { + return error("Invalid number"); + } else if number == 1 { + return MONDAY; + } else if number == 2 { + return TUESDAY; + } else if number == 3 { + return WEDNESDAY; + } else if number == 4 { + return THURSDAY; + } else if number == 5 { + return FRIDAY; + } else if number == 6 { + return SATURDAY; + } else { + return SUNDAY; + } + } + + isolated resource function get time() returns Time { + return { + weekday: MONDAY, + time: "22:10:33" + }; + } + + isolated resource function get isHoliday(Weekday weekday) returns boolean { + if weekday == SATURDAY || weekday == SUNDAY { + return true; + } + return false; + } + + isolated resource function get holidays() returns Weekday[] { + return [SATURDAY, SUNDAY]; + } + + isolated resource function get openingDays() returns (Weekday|error)[] { + return [MONDAY, TUESDAY, error("Holiday!"), THURSDAY, FRIDAY]; + } + + isolated resource function get specialHolidays() returns (Weekday|error)?[] { + return [TUESDAY, error("Holiday!"), THURSDAY]; + } + + resource function get company() returns Company { + return company; + } + + resource function get month(Month month) returns string { + return month; + } + + isolated resource function get ids() returns int[] { + return [0, 1, 2]; + } + + isolated resource function get idsWithErrors() returns (int|error)[] { + return [0, 1, 2, error("Not Found!")]; + } + + isolated resource function get friends() returns (string|error)?[] { + return ["walter", "jessie", error("Not Found!")]; + } + + isolated resource function get project() returns Project { + return { + name: "Ballerina", + manager: "Unknown", + tasks: { + sprint: 75, + subTasks: ["GraphQL-task1", error("Undefined task!"), "HTTP-task2"] + } + }; + } +} + +service /snowtooth on serviceTypeListener { + isolated resource function get allLifts(Status? status) returns Lift[] { + if status is Status { + return from var lift in liftTable + where lift.status == status + select new (lift); + } else { + return from var lift in liftTable + select new (lift); + } + } + + isolated resource function get allTrails(Status? status) returns Trail[] { + if status is Status { + return from var trail in trailTable + where trail.status == status + select new (trail); + } else { + return from var trail in trailTable + select new (trail); + } + } + + isolated resource function get lift(string id) returns Lift? { + LiftRecord[] lifts = from var lift in liftTable + where lift.id == id + select lift; + if lifts.length() > 0 { + return new Lift(lifts[0]); + } + return; + } + + isolated resource function get trail(string id) returns Trail? { + TrailRecord[] trails = from var trail in trailTable + where trail.id == id + select trail; + if trails.length() > 0 { + return new Trail(trails[0]); + } + return; + } + + isolated resource function get liftCount(Status status) returns int { + LiftRecord[] lifts = from var lift in liftTable + where lift.status == status + select lift; + return lifts.length(); + } + + isolated resource function get trailCount(Status status) returns int { + TrailRecord[] trails = from var trail in trailTable + where trail.status == status + select trail; + return trails.length(); + } + + isolated resource function get search(Status status) returns SearchResult[] { + SearchResult[] searchResults = []; + Trail[] trails = from var trail in trailTable + where trail.status == status + select new (trail); + Lift[] lifts = from var lift in liftTable + where lift.status == status + select new (lift); + foreach Trail trail in trails { + searchResults.push(trail); + } + foreach Lift lift in lifts { + searchResults.push(lift); + } + return searchResults; + } +} + +service /unions on serviceTypeListener { + isolated resource function get profile(int id) returns StudentService|TeacherService { + if id < 100 { + return new StudentService(1, "Jesse Pinkman"); + } else { + return new TeacherService(737, "Walter White", "Chemistry"); + } + } + + isolated resource function get search() returns (StudentService|TeacherService)[] { + StudentService s = new StudentService(1, "Jesse Pinkman"); + TeacherService t = new TeacherService(737, "Walter White", "Chemistry"); + return [s, t]; + } + + isolated resource function get services() returns PeopleService?[] { + StudentService s = new StudentService(1, "Jesse Pinkman"); + TeacherService t = new TeacherService(737, "Walter White", "Chemistry"); + return [s, t, ()]; + } +} + +service /union_type_names on serviceTypeListener { + private final StudentService s = new StudentService(1, "Jesse Pinkman"); + private final TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); + + isolated resource function get nonNullSingleObject() returns PeopleService { + return self.s; + } + + isolated resource function get nullableSingleObject() returns PeopleService? { + return self.s; + } + + isolated resource function get nonNullArray() returns PeopleService[] { + return [self.s, self.t]; + } + + isolated resource function get nullableArray() returns PeopleService?[] { + return [self.s, ()]; + } + + isolated resource function get nonNullUndefinedUnionType() returns StudentService|TeacherService { + return self.s; + } + + isolated resource function get nonNullUndefinedUnionTypeArray() returns (StudentService|TeacherService)[] { + return [self.s]; + } + + isolated resource function get nullableUndefinedUnionType() returns StudentService|TeacherService? { + return self.s; + } + + isolated resource function get nullableUndefinedUnionTypeArray() returns (StudentService|TeacherService)?[] { + return [self.s, ()]; + } +} + +isolated service /mutations on basicListener { + private Person p; + private TeacherService t; + + isolated function init() { + self.p = p2.clone(); + self.t = new (1, "Walter Bishop", "Physics"); + } + + isolated resource function get person() returns Person { + lock { + return self.p; + } + } + + isolated remote function setName(string name) returns Person { + lock { + Person p = {name: name, age: self.p.age, address: self.p.address}; + self.p = p; + return self.p; + } + } + + isolated remote function setCity(string city) returns Person { + lock { + Person p = { + name: self.p.name, + age: self.p.age, + address: { + number: self.p.address.number, + street: self.p.address.street, + city: city + } + }; + self.p = p; + return self.p; + } + } + + isolated remote function setTeacherName(string name) returns TeacherService { + lock { + self.t.setName(name); + return self.t; + } + } + + isolated remote function setTeacherSubject(string subject) returns TeacherService { + lock { + self.t.setSubject(subject); + return self.t; + } + } +} + +service /null_values on basicListener { + resource function get profile(int? id) returns Person { + if id == () { + return p1; + } + return p2; + } + + remote function profile(string? name = ()) returns Person { + if name == () { + return p1; + } + return p2; + } + + resource function get book(Author? author) returns Book { + if author == {name: (), id: 1} { + return b1; + } else if author == {name: "J. K. Rowling", id: 2} { + return { + name: "Harry Potter and the Prisnor of the Azkaban", + author: "J. K. Rowling" + }; + } + return b3; + } + + resource function get 'null(int? value) returns string? { + if value != () { + return "Hello"; + } + return; + } + + resource function get name(graphql:Context context, graphql:Field 'field, int? id) returns string? { + if id == () { + graphql:__addError(context, { + message: "Data not found", + locations: ['field.getLocation()], + path: 'field.getPath() + }); + return; + } + return "Walter White"; + } +} + +service /intersection_types on basicListener { + isolated resource function get name(Species & readonly species) returns string { + return species.specificName; + } + + isolated resource function get city(Address address) returns string { + return address.city; + } + + isolated resource function get profile() returns ProfileDetail & readonly { + ProfileDetail profile = {name: "Walter White", age: 52}; + return profile.cloneReadOnly(); + } + + isolated resource function get book() returns Book { + return {name: "Nineteen Eighty-Four", author: "George Orwell"}; + } + + isolated resource function get names(Species[] & readonly species) returns string[] { + return species.map(sp => sp.specificName); + } + + isolated resource function get cities(Address[] addresses) returns string[] { + return addresses.map(address => address.city); + } + + isolated resource function get profiles() returns ProfileDetail[] & readonly { + ProfileDetail[] profiles = [ + {name: "Walter White", age: 52}, + {name: "Jesse Pinkman", age: 25} + ]; + return profiles.cloneReadOnly(); + } + + isolated resource function get books() returns Book[] { + return [ + {name: "Nineteen Eighty-Four", author: "George Orwell"}, + {name: "The Magic of Reality", author: "Richard Dawkins"} + ]; + } + + isolated resource function get commonName(Animal animal) returns string { + return animal.commonName; + } + + isolated resource function get ownerName(Pet pet) returns string { + return pet.ownerName; + } +} + +service /nullable_inputs on basicListener { + resource function get city(Address? address) returns string? { + if address is Address { + return address.city; + } + return; + } + + resource function get cities(Address[]? addresses) returns string[]? { + if addresses is Address[] { + return addresses.map(address => address.city); + } + return; + } + + resource function get accountNumber(Account account) returns int { + return account.number; + } +} + +# GraphQL service with documentation. +service /documentation on basicListener { + + # Greets a person with provided name. + # + # + name - The name of the person + # + return - The personalized greeting message + isolated resource function get greeting(string name) returns string { + return string `Hello ${name}`; + } + + # Returns a predefined instrument. + # + # + return - Details of the Guitar + isolated resource function get instrument() returns Instrument { + return { + name: "Guitar", + 'type: STRINGS + }; + } + + # Updates a shape in the database. + # + # + name - Name of the new shape + # + edges - Number of edges of the new shape + # + return - The newly created shape + remote function addShape(string name, int edges) returns Shape { + return {name: name, edges: edges}; + } +} + +# GraphQL service with deprecated fields and enum values. +service /deprecation on wrappedListener { + + # Hello world field. + # + name - The name of the person + # + return - The personalized greeting message + # # Deprecated + # Use the `greeting` field instead of this field. + @deprecated + isolated resource function get hello(string name) returns string { + return string `Hello ${name}`; + } + + # Greets a person with provided name. + # + # + name - The name of the person + # + return - The personalized greeting message + isolated resource function get greeting(string name) returns string { + return string `Hello ${name}`; + } + + # Retrieve information about the person. + # + return - The person object + isolated resource function get profile() returns DeprecatedProfile { + return {name: "Alice", age: 30, address: {number: 1, street: "main", city: "NYC"}}; + } + + # Retrieve information about music school. + # + return - The school object + isolated resource function get school() returns School { + return new ("The Juilliard School"); + } + + # Add a new person. + # + return - The person object + remote function addProfile(string name, int age) returns DeprecatedProfile { + return {name: name, age: age, address: {number: 1, street: "main", city: "NYC"}}; + } + + # Creates a new instrument. + # + # + name - Name of the instrument + # + 'type - Type of the instrument + # + return - The newly created instrument + # # Deprecated + # Use the `addInstrument` field instead of this. + @deprecated + remote function newInstrument(string name, InstrumentType 'type) returns Instrument { + return {name: name, 'type: 'type}; + } + + # Adds a new instrument to the database. + # + # + name - Name of the instrument + # + 'type - Type of the instrument + # + return - The newly added instrument + remote function addInstrument(string name, InstrumentType 'type) returns Instrument { + return {name: name, 'type: 'type}; + } + + # Subscribes to the new instruments. + # + # + return - The instrument name list + # # Deprecated + # Use the `instruments` field instead of this. + @deprecated + resource function subscribe newInstruments() returns stream { + return ["Guitar", "Violin", "Drums"].toStream(); + } + + # Subscribes to the new instruments. + # + # + return - The instrument name list + resource function subscribe instruments() returns stream { + return ["Guitar", "Violin", "Drums"].toStream(); + } +} + +service /maps on basicListener { + private final Languages languages; + + function init() { + self.languages = { + name: { + backend: "Ballerina", + frontend: "JavaScript", + data: "Python", + native: "C++" + } + }; + } + + isolated resource function get languages() returns Languages { + return self.languages; + } +} + +graphql:Service greetingService = service object { + resource function get greeting() returns string { + return "Hello, World"; + } +}; + +graphql:Service greetingService2 = @graphql:ServiceConfig {maxQueryDepth: 5} service object { + resource function get greeting() returns string { + return "Hello, World"; + } +}; + +service /covid19 on basicListener { + resource function get all() returns table { + table covidEntryTable = table [ + {isoCode: "AFG"}, + {isoCode: "SL"}, + {isoCode: "US"} + ]; + return covidEntryTable; + } +} + +table reviews = table [ + {product: new ("1"), score: 20, description: "Product 01"}, + {product: new ("2"), score: 20, description: "Product 02"}, + {product: new ("3"), score: 20, description: "Product 03"}, + {product: new ("4"), score: 20, description: "Product 04"}, + {product: new ("5"), score: 20, description: "Product 05"} +]; + +service /reviews on wrappedListener { + resource function get latest() returns Review { + return reviews.toArray().pop(); + } + + resource function get all() returns table { + return reviews; + } + + resource function get top3() returns Review[] { + return from var review in reviews + limit 3 + select review; + } + + resource function get account() returns AccountRecords { + return {details: {acc1: new ("James", 2022), acc2: new ("Paul", 2015)}}; + } +} + +isolated service /service_with_http2 on http2BasedListener { + private Person p; + + isolated function init() { + self.p = p2.clone(); + } + + isolated resource function get person() returns Person { + lock { + return self.p; + } + } + + isolated remote function setName(string name) returns Person { + lock { + Person p = {name: name, age: self.p.age, address: self.p.address}; + self.p = p; + return self.p; + } + } +} + +isolated service /service_with_http1 on wrappedListener { + private Person p; + + isolated function init() { + self.p = p2.clone(); + } + + isolated resource function get person() returns Person { + lock { + return self.p; + } + } + + isolated remote function setName(string name) returns Person { + lock { + Person p = {name: name, age: self.p.age, address: self.p.address}; + self.p = p; + return self.p; + } + } +} + +@display { + label: "diplay", + id: "display-1" +} +service /annotations on wrappedListener { + resource function get greeting() returns string { + return "Hello"; + } +} + +service /id_annotation_1 on basicListener { + resource function get student1(@graphql:ID int id1) returns Student1 { + return new Student1(8); + } + + resource function get student2(@graphql:ID float[] id2) returns Student2 { + return new Student2([1.0, 2.0]); + } + + resource function get student3(@graphql:ID uuid:Uuid?[] id3) returns Student3|error { + return new Student3([check uuid:createType1AsRecord()]); + } + + resource function get student4(@graphql:ID int?[]? id4) returns Student4 { + return new Student4([1, 2, (), 4]); + } +} + +public distinct service class Student1 { + final int id; + + function init(int id) { + self.id = id; + } + + resource function get id() returns @graphql:ID int { + return self.id; + } +} + +public distinct service class Student2 { + final float[] id; + + function init(float[] id) { + self.id = id; + } + + resource function get id() returns @graphql:ID float[] { + return self.id; + } +} + +public distinct service class Student3 { + final uuid:Uuid?[] id; + + function init(uuid:Uuid?[] id) { + self.id = id; + } + + resource function get id() returns @graphql:ID uuid:Uuid?[] { + return self.id; + } +} + +public distinct service class Student4 { + final int?[]? id; + + function init(int?[]? id) { + self.id = id; + } + + resource function get id() returns @graphql:ID int?[]? { + return self.id; + } +} + +service /id_annotation_2 on basicListener { + resource function get stringId(@graphql:ID string stringId) returns string { + return "Hello, World"; + } + + resource function get intId(@graphql:ID int intId) returns string { + return "Hello, World"; + } + + resource function get floatId(@graphql:ID float floatId) returns string { + return "Hello, World"; + } + + resource function get decimalId(@graphql:ID decimal decimalId) returns string { + return "Hello, World"; + } + + resource function get stringId1(@graphql:ID string? stringId) returns string { + return "Hello, World"; + } + + resource function get intId1(@graphql:ID int? intId) returns string { + return "Hello, World"; + } + + resource function get floatId1(@graphql:ID float? floatId) returns string { + return "Hello, World"; + } + + resource function get decimalId1(@graphql:ID decimal? decimalId) returns string { + return "Hello, World"; + } + + resource function get intIdReturnRecord(@graphql:ID int intId) returns Student5 { + return new Student5(2, "Jennifer Flackett"); + } + + resource function get intArrayReturnRecord(@graphql:ID int[] intId) returns Student5 { + return new Student5(333, "Antoni Porowski"); + } + + resource function get stringArrayReturnRecord(@graphql:ID string[] stringId) returns Student5 { + return new Student5(212, "Andrew Glouberman"); + } + + resource function get floatArrayReturnRecord(@graphql:ID float[] floatId) returns Student5 { + return new Student5(422, "Elliot Birch"); + } + + resource function get decimalArrayReturnRecord(@graphql:ID decimal[] decimalId) returns Student5 { + return new Student5(452, "Edward MacDell"); + } + + resource function get uuidReturnRecord(@graphql:ID uuid:Uuid uuidId) returns Student5 { + return new Student5(2678, "Abuela Alvarez"); + } + + resource function get uuidArrayReturnRecord(@graphql:ID uuid:Uuid[] uuidId) returns Student5 { + return new Student5(678, "Andy Garcia"); + } + + resource function get uuidArrayReturnRecord1(@graphql:ID uuid:Uuid[]? uuidId) returns Student5 { + return new Student5(563, "Aretha Franklin"); + } + + resource function get stringIdReturnRecord(@graphql:ID string stringId) returns PersonId { + return {id: 543, name: "Marmee March", age: 12}; + } + + resource function get stringArrayReturnRecordArray(@graphql:ID string[] stringIds) returns PersonId[] { + return [ + {id: 789, name: "Beth Match", age: 15}, + {id: 678, name: "Jo March", age: 16}, + {id: 543, name: "Amy March", age: 12} + ]; + } + + resource function get floatArrayReturnRecordArray(@graphql:ID float[] floatIds) returns PersonId[] { + return [ + {id: 789, name: "Beth Match", age: 15}, + {id: 678, name: "Jo March", age: 16}, + {id: 543, name: "Amy March", age: 12} + ]; + } +} + +public type PersonId record {| + @graphql:ID + int id; + string name; + int age; +|}; + +public distinct service class Student5 { + final int id; + final string name; + + function init(int id, string name) { + self.id = id; + self.name = name; + } + + resource function get id() returns @graphql:ID int { + return self.id; + } + + resource function get name() returns string { + return self.name; + } +} + +service /defaultParam on wrappedListener { + resource function get intParam(int a = 1) returns string? => (); + + resource function get floatParam(float b = 2.0) returns string? => (); + + resource function get decimalParam(decimal c = 1e-10) returns string? => (); + + resource function get stringParam(string d = "value") returns string? => (); + + resource function get booleanParam(boolean e = true) returns string? => (); + + resource function get nullableParam(int? f = DEFAULT_INT_VALUE) returns string? => (); + + remote function enumParam(Sex g = MALE) returns string? => (); + + remote function inputObjectParam(InputObject h) returns string? => (); + + remote function inputObjectArrayParam(InputObject[] i = [ + {name: "name2", bmiHistory: [1.0, 2.0]}, + {name: "name3", bmiHistory: [1e-7, 2.0]} + ]) returns string? => (); + + resource function subscribe idArrayParam(@graphql:ID string[] j = ["id1"]) returns stream? => (); + + resource function get multipleParams( + int a = 1, + float b = 2.0, + decimal c = 1e-10, + string d = "value", + boolean e = true, + int? f = DEFAULT_INT_VALUE, + Sex g = MALE, + InputObject h = {name: "name2", bmiHistory: [30.0, 29.0, 20.0d]}, + InputObject[] i = [ + {name: "name3", bmiHistory: [30.0, 29.0]}, + {name: "name4", bmiHistory: [2.9e1, 31.0]} + ], + @graphql:ID string[] j = ["id1"]) returns string? => (); + + resource function get nestedField() returns NestedField => new; +} + +class ServiceDeclarationOnObjectField { + + private graphql:Service objectFieldService = service object { + resource function get greeting() returns string { + return "Hello world"; + } + }; + + public function init() { + } + + public function getService() returns graphql:Service { + return self.objectFieldService; + } + +} + +service /evict_server_cache on basicListener { + private string name = "Walter White"; + + isolated resource function get greet() returns string { + return "Hello, " + self.name; + } + + @graphql:ResourceConfig { + cacheConfig: { + enabled: true + } + } + isolated resource function get name(int id) returns string { + return self.name; + } + + isolated remote function updateName(graphql:Context context, string name) returns string|error { + check context.invalidate("name"); + self.name = name; + return self.name; + } +} diff --git a/ballerina-tests/tests/values.bal b/ballerina-tests/graphql-service-test-suite/tests/values.bal similarity index 66% rename from ballerina-tests/tests/values.bal rename to ballerina-tests/graphql-service-test-suite/tests/values.bal index 85333b483..4fbb65706 100644 --- a/ballerina-tests/tests/values.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/values.bal @@ -118,12 +118,12 @@ final readonly & Book b10 = { author: "J.K Rowling" }; -final readonly & Movie m1 = { +final readonly & Movie m1 = { movieName: "Harry Potter and the Sorcerer's Stone", director: "Chris Columbus" }; -final readonly & Movie m2 = { +final readonly & Movie m2 = { movieName: "Sherlock Holmes", director: "Dexter Fletcher" }; @@ -183,22 +183,22 @@ final readonly & Student s3 = { final readonly & Student[] students = [s1, s2, s3]; -final readonly & EmployeeTable employees = table[ - { id: 1, name: "John Doe", salary: 1000.00 }, - { id: 2, name: "Jane Doe", salary: 2000.00 }, - { id: 3, name: "Johnny Roe", salary: 500.00 } +final readonly & EmployeeTable employees = table [ + {id: 1, name: "John Doe", salary: 1000.00}, + {id: 2, name: "Jane Doe", salary: 2000.00}, + {id: 3, name: "Johnny Roe", salary: 500.00} ]; -final readonly & EmployeeTable oldEmployees = table[ - { id: 4, name: "John", salary: 5000.00 }, - { id: 5, name: "Jane", salary: 7000.00 }, - { id: 6, name: "Johnny", salary: 1000.00 } +final readonly & EmployeeTable oldEmployees = table [ + {id: 4, name: "John", salary: 5000.00}, + {id: 5, name: "Jane", salary: 7000.00}, + {id: 6, name: "Johnny", salary: 1000.00} ]; public final readonly & table key(id) liftTable = table [ - { id: "astra-express", name: "Astra Express", status: OPEN, capacity: 10, night: false, elevationgain: 20}, - { id: "jazz-cat", name: "Jazz Cat", status: CLOSED, capacity: 5, night: true, elevationgain: 30}, - { id: "jolly-roger", name: "Jolly Roger", status: CLOSED, capacity: 8, night: true, elevationgain: 10} + {id: "astra-express", name: "Astra Express", status: OPEN, capacity: 10, night: false, elevationgain: 20}, + {id: "jazz-cat", name: "Jazz Cat", status: CLOSED, capacity: 5, night: true, elevationgain: 30}, + {id: "jolly-roger", name: "Jolly Roger", status: CLOSED, capacity: 8, night: true, elevationgain: 10} ]; public final readonly & table key(id) trailTable = table [ @@ -230,89 +230,35 @@ final readonly & Contact contact3 = { final readonly & Worker w1 = { id: "id1", name: "John Doe", - contacts: { home: contact1 } + contacts: {home: contact1} }; final readonly & Worker w2 = { id: "id2", name: "Jane Doe", - contacts: { home: contact2 } + contacts: {home: contact2} }; final readonly & Worker w3 = { id: "id3", name: "Jonny Doe", - contacts: { home: contact3 } + contacts: {home: contact3} }; -final readonly & map workers = { id1: w1, id2: w2, id3: w3 }; -final readonly & map contacts = { home1: contact1, home2: contact2, home3: contact3 }; +final readonly & map workers = {id1: w1, id2: w2, id3: w3}; +final readonly & map contacts = {home1: contact1, home2: contact2, home3: contact3}; final readonly & Company company = { workers: workers.cloneReadOnly(), contacts: contacts.cloneReadOnly() }; -final readonly & TaskTable tasks = table[ +final readonly & TaskTable tasks = table [ {sprint: 77, subTasks: ["GraphQL-task1", error("Undefined task!"), "HTTP-task2"]} ]; -// WebSocket Message types -const WS_INIT = "connection_init"; -const WS_ACK = "connection_ack"; -const WS_PING = "ping"; -const WS_PONG = "pong"; -const WS_SUBSCRIBE = "subscribe"; -const WS_NEXT = "next"; -const WS_ERROR = "error"; -const WS_COMPLETE = "complete"; - // WebSocket Sub Protocols const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; const WS_SUB_PROTOCOL = "Sec-WebSocket-Protocol"; -final isolated table key(id) authorTable = table [ - {id: 1, name: "Author 1"}, - {id: 2, name: "Author 2"}, - {id: 3, name: "Author 3"}, - {id: 4, name: "Author 4"}, - {id: 5, name: "Author 5"} -]; - -final isolated table key(id) bookTable = table [ - {id: 1, title: "Book 1", author: 1}, - {id: 2, title: "Book 2", author: 1}, - {id: 3, title: "Book 3", author: 1}, - {id: 4, title: "Book 4", author: 2}, - {id: 5, title: "Book 5", author: 2}, - {id: 6, title: "Book 6", author: 3}, - {id: 7, title: "Book 7", author: 3}, - {id: 8, title: "Book 8", author: 4}, - {id: 9, title: "Book 9", author: 5} -]; - -isolated int dispatchCountOfBookLoader = 0; -isolated int dispatchCountOfAuthorLoader = 0; -isolated int dispatchCountOfUpdateAuthorLoader = 0; - const int DEFAULT_INT_VALUE = 20; - -final isolated table key(id) authorTable2 = table [ - {id: 1, name: "Author 1"}, - {id: 2, name: "Author 2"}, - {id: 3, name: "Author 3"}, - {id: 4, name: "Author 4"}, - {id: 5, name: "Author 5"} -]; - -final isolated table key(id) bookTable2 = table [ - {id: 1, title: "Book 1", author: 1}, - {id: 2, title: "Book 2", author: 1}, - {id: 3, title: "Book 3", author: 1}, - {id: 4, title: "Book 4", author: 2}, - {id: 5, title: "Book 5", author: 2}, - {id: 6, title: "Book 6", author: 3}, - {id: 7, title: "Book 7", author: 3}, - {id: 8, title: "Book 8", author: 4}, - {id: 9, title: "Book 9", author: 5} -]; diff --git a/ballerina-tests/entities.bal b/ballerina-tests/graphql-subgraph-test-suite/entities.bal similarity index 82% rename from ballerina-tests/entities.bal rename to ballerina-tests/graphql-subgraph-test-suite/entities.bal index 252db4656..558f6dd59 100644 --- a/ballerina-tests/entities.bal +++ b/ballerina-tests/graphql-subgraph-test-suite/entities.bal @@ -47,21 +47,9 @@ distinct service class Star { } } -type StarInfo record { - string name; - string constellation; - string designation; -}; - -final readonly & StarInfo[] stars = [ - {name: "Absolutno*", constellation: "Lynx", designation: "XO-5"}, - {name: "Acamar", constellation: "Eridanus", designation: "θ1 Eridani A"}, - {name: "Achernar", constellation: "Eridanus", designation: "α Eridani A"} -]; - isolated function findStarByName(string name) returns Star|error { - StarInfo startInfo = check trap stars.filter(star => star.name == name).shift(); - return new (startInfo); + StarInfo startInfo = check trap stars.filter(star => star.name == name).shift(); + return new (startInfo); } @subgraph:Entity { @@ -83,12 +71,6 @@ public type Planet record { Moon moon?; }; -final readonly & Planet[] planets = [ - {id: 1, name: "Mercury", mass: 0.383, numberOfMoons: 0}, - {id: 2, name: "Venus", mass: 0.949, numberOfMoons: 0}, - {id: 3, name: "Earth", mass: 1, numberOfMoons: 1, moon: {name: "moon"}} -]; - isolated function findPlanetByName(string name) returns Planet|error { return trap planets.filter(planet => planet.name == name).shift(); } diff --git a/ballerina-tests/graphql-subgraph-test-suite/records.bal b/ballerina-tests/graphql-subgraph-test-suite/records.bal new file mode 100644 index 000000000..1c8f20396 --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/records.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +type StarInfo record { + string name; + string constellation; + string designation; +}; diff --git a/ballerina-tests/subgraphs.bal b/ballerina-tests/graphql-subgraph-test-suite/subgraphs.bal similarity index 86% rename from ballerina-tests/subgraphs.bal rename to ballerina-tests/graphql-subgraph-test-suite/subgraphs.bal index 16aa15587..59412a9a2 100644 --- a/ballerina-tests/subgraphs.bal +++ b/ballerina-tests/graphql-subgraph-test-suite/subgraphs.bal @@ -25,9 +25,15 @@ public graphql:Service subgraphServivce = @subgraph:Subgraph service object { resource function get greeting() returns string => "welcome"; }; +listener graphql:Listener graphqlListener = new (9098); + @subgraph:Subgraph service /reviews on graphqlListener { resource function get reviews() returns ReviewData[] { return []; } } + +public isolated service class ReviewData { + isolated resource function get id() returns string => "123"; +} diff --git a/ballerina-tests/tests/40_subgraph.bal b/ballerina-tests/graphql-subgraph-test-suite/tests/01_subgraph_tests.bal similarity index 73% rename from ballerina-tests/tests/40_subgraph.bal rename to ballerina-tests/graphql-subgraph-test-suite/tests/01_subgraph_tests.bal index 1d4adcd9c..9e7ab46c1 100644 --- a/ballerina-tests/tests/40_subgraph.bal +++ b/ballerina-tests/graphql-subgraph-test-suite/tests/01_subgraph_tests.bal @@ -15,6 +15,7 @@ // under the License. import ballerina/graphql; +import ballerina/graphql_test_common as common; import ballerina/test; @test:Config { @@ -26,7 +27,7 @@ isolated function testSubgrapWithValidQuery() returns error? { graphql:Client graphqlClient = check new (url); json response = check graphqlClient->execute(document); json expectedPayload = {data: {greet: "welcome"}}; - assertJsonValuesWithOrder(response, expectedPayload); + common:assertJsonValuesWithOrder(response, expectedPayload); } @test:Config { @@ -34,11 +35,11 @@ isolated function testSubgrapWithValidQuery() returns error? { dataProvider: dataProviderToQuerySubgraph } function testQueryingSubgraph(string documentFileName) returns error? { - string document = check getGraphqlDocumentFromFile(documentFileName); + string document = check common:getGraphqlDocumentFromFile(documentFileName); string url = "localhost:9088/subgraph"; - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(documentFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = check common:getJsonContentFromFile(documentFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderToQuerySubgraph() returns string[][] { @@ -59,11 +60,11 @@ function dataProviderToQuerySubgraph() returns string[][] { dataProvider: dataProviderToQuerySubgraphWithVariable } function testQueryingSubgraphWithVariables(string responseFileName, json variable) returns error? { - string document = check getGraphqlDocumentFromFile("querying_subgraph_with_variable"); + string document = check common:getGraphqlDocumentFromFile("querying_subgraph_with_variable"); string url = "localhost:9088/subgraph"; - json actualPayload = check getJsonPayloadFromService(url, document, variable); - json expectedPayload = check getJsonContentFromFile(responseFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); + json actualPayload = check common:getJsonPayloadFromService(url, document, variable); + json expectedPayload = check common:getJsonContentFromFile(responseFileName); + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } function dataProviderToQuerySubgraphWithVariable() returns map<[string, json]> { @@ -98,24 +99,24 @@ isolated function testQueringSdlOnSubgraph() returns error? { json response = check graphqlClient->execute(document); string sdl = check response.data._service.sdl.ensureType(); // Replace line seperator on windows "\r\n" with "\n" - sdl = re`\r\n`.replaceAll(sdl, "\n"); + sdl = re `\r\n`.replaceAll(sdl, "\n"); response = {data: {_service: {sdl}}}; - json expectedPayload = check getJsonContentFromFile("quering_sdl_on_subgraph"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("quering_sdl_on_subgraph"); + common:assertJsonValuesWithOrder(response, expectedPayload); } @test:Config { groups: ["federation", "subgraph"] } function testAttachingSubgraphServiceToDynamicListener() returns error? { - check specialTypesTestListener.attach(subgraphServivce, "subgraph"); + check subgraphListener.attach(subgraphServivce, "subgraph"); string url = "http://localhost:9095/subgraph"; graphql:Client graphqlClient = check new (url); - string document = check getGraphqlDocumentFromFile("querying_entities_field_on_subgraph"); + string document = check common:getGraphqlDocumentFromFile("querying_entities_field_on_subgraph"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("querying_entities_field_on_subgraph"); - check specialTypesTestListener.detach(subgraphServivce); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("querying_entities_field_on_subgraph"); + check subgraphListener.detach(subgraphServivce); + common:assertJsonValuesWithOrder(response, expectedPayload); } @test:Config { @@ -124,8 +125,8 @@ function testAttachingSubgraphServiceToDynamicListener() returns error? { function testReferenceResolverReturningRecordWithObjectFields() returns error? { string url = "http://localhost:9098/reviews"; graphql:Client graphqlClient = check new (url); - string document = check getGraphqlDocumentFromFile("test_reference_resolver_returning_record_with_object_fields"); + string document = check common:getGraphqlDocumentFromFile("test_reference_resolver_returning_record_with_object_fields"); json response = check graphqlClient->execute(document); - json expectedPayload = check getJsonContentFromFile("test_reference_resolver_returning_record_with_object_fields"); - assertJsonValuesWithOrder(response, expectedPayload); + json expectedPayload = check common:getJsonContentFromFile("test_reference_resolver_returning_record_with_object_fields"); + common:assertJsonValuesWithOrder(response, expectedPayload); } diff --git a/ballerina-tests/graphql-subgraph-test-suite/tests/listeners.bal b/ballerina-tests/graphql-subgraph-test-suite/tests/listeners.bal new file mode 100644 index 000000000..3ccf7b58f --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/tests/listeners.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener subgraphListener = new (9095); diff --git a/ballerina-tests/tests/resources/documents/introspection_on_subgraph.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/introspection_on_subgraph.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/introspection_on_subgraph.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/introspection_on_subgraph.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_entities_field_on_subgraph.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_on_subgraph.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_entities_field_on_subgraph.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_on_subgraph.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_entities_field_with_list_of_non_any_argument.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_list_of_non_any_argument.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_entities_field_with_list_of_non_any_argument.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_list_of_non_any_argument.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_entities_field_with_list_of_null_values.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_list_of_null_values.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_entities_field_with_list_of_null_values.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_list_of_null_values.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_entities_field_with_null_argument.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_null_argument.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_entities_field_with_null_argument.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_null_argument.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_entities_field_with_object_argument.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_object_argument.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_entities_field_with_object_argument.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_with_object_argument.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_entities_field_without_typename_in_argument.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_without_typename_in_argument.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_entities_field_without_typename_in_argument.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_entities_field_without_typename_in_argument.graphql diff --git a/ballerina-tests/tests/resources/documents/querying_subgraph_with_variable.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_subgraph_with_variable.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/querying_subgraph_with_variable.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/querying_subgraph_with_variable.graphql diff --git a/ballerina-tests/tests/resources/documents/test_reference_resolver_returning_record_with_object_fields.graphql b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/test_reference_resolver_returning_record_with_object_fields.graphql similarity index 100% rename from ballerina-tests/tests/resources/documents/test_reference_resolver_returning_record_with_object_fields.graphql rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/documents/test_reference_resolver_returning_record_with_object_fields.graphql diff --git a/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/introspection_on_subgraph.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/introspection_on_subgraph.json new file mode 100644 index 000000000..2e1fd0acc --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/introspection_on_subgraph.json @@ -0,0 +1,84 @@ +{ + "data": { + "__schema": { + "types": [ + { "name": "link__Purpose", "kind": "ENUM" }, + { "name": "__TypeKind", "kind": "ENUM" }, + { "name": "Query", "kind": "OBJECT" }, + { "name": "__Type", "kind": "OBJECT" }, + { "name": "__EnumValue", "kind": "OBJECT" }, + { "name": "Moon", "kind": "OBJECT" }, + { "name": "ReviewData", "kind": "OBJECT" }, + { "name": "Satellite", "kind": "OBJECT" }, + { "name": "String", "kind": "SCALAR" }, + { "name": "Int", "kind": "SCALAR" }, + { "name": "_Entity", "kind": "UNION" }, + { "name": "FieldSet", "kind": "SCALAR" }, + { "name": "Decimal", "kind": "SCALAR" }, + { "name": "Star", "kind": "OBJECT" }, + { "name": "_Service", "kind": "OBJECT" }, + { "name": "Planet", "kind": "OBJECT" }, + { "name": "Boolean", "kind": "SCALAR" }, + { "name": "ProductData", "kind": "OBJECT" }, + { "name": "_Any", "kind": "SCALAR" }, + { "name": "__Field", "kind": "OBJECT" }, + { "name": "__Schema", "kind": "OBJECT" }, + { "name": "__DirectiveLocation", "kind": "ENUM" }, + { "name": "link__Import", "kind": "SCALAR" }, + { "name": "__InputValue", "kind": "OBJECT" }, + { "name": "__Directive", "kind": "OBJECT" } + ] + }, + "Query": { + "name": "Query", + "fields": [ + { "name": "greet", "args": [] }, + { "name": "_service", "args": [] }, + { + "name": "_entities", + "args": [ + { + "name": "representations", + "type": { + "kind": "NON_NULL", + "ofType": { + "kind": "LIST", + "ofType": { + "kind": "NON_NULL", + "ofType": { + "kind": "SCALAR", + "name": "_Any", + "ofType": null + } + } + } + } + } + ] + } + ] + }, + "_Entity": { + "name": "_Entity", + "possibleTypes": [ + { "name": "ProductData" }, + { "name": "Moon" }, + { "name": "Star" }, + { "name": "Satellite" }, + { "name": "Planet" } + ] + }, + "Service": { + "name": "_Service", + "fields": [ + { + "name": "sdl", + "type": { + "kind": "NON_NULL", + "ofType": { "kind": "SCALAR", "name": "String" } + } + } + ] + } + } +} diff --git a/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/quering_sdl_on_subgraph.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/quering_sdl_on_subgraph.json new file mode 100644 index 000000000..83c701928 --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/quering_sdl_on_subgraph.json @@ -0,0 +1,7 @@ +{ + "data": { + "_service": { + "sdl": "extend schema @link(url: \"https://specs.apollo.dev/federation/v2.0\", import: [\"@key\" ,\"FieldSet\"]) \n\ndirective @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT|INTERFACE\n\ndirective @link(url: String!, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA\n\ntype Query {\n greet: String!\n _service: _Service!\n _entities(representations: [_Any!]!): [_Entity]!\n}\n\ntype ProductData @key(fields: \"id\") {\n id: String!\n reviews: [ReviewData!]!\n}\n\ntype ReviewData {\n id: String!\n}\n\ntype Moon @key(fields: \"name\", resolvable: false) {\n name: String!\n}\n\ntype Star @key(fields: \"name\") {\n name: String!\n constellation: String!\n designation: String!\n}\n\ntype Satellite @key(fields: \"name\") {\n name: String!\n MissionDuration: Int!\n}\n\ntype Planet @key(fields: \"name\") @key(fields: \"id\") {\n id: Int!\n name: String!\n mass: Decimal!\n numberOfMoons: Int!\n moon: Moon\n}\n\n\"The `Decimal` type corresponds to a subset of IEEE 754-2008 128-bit decimal (radix 10) floating point numbers\"\nscalar Decimal\n\nscalar _Any\n\nscalar FieldSet\n\nscalar link__Import\n\nenum link__Purpose {\n \"`EXECUTION` features provide metadata necessary for operation execution.\"\n EXECUTION\n \"`SECURITY` features provide metadata necessary to securely resolve fields.\"\n SECURITY\n}\n\ntype _Service {\n sdl: String!\n}\n\nunion _Entity = ProductData|Moon|Star|Satellite|Planet" + } + } +} diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_on_subgraph.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_on_subgraph.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_on_subgraph.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_on_subgraph.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_argument.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_argument.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_argument.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_argument.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_variable.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_variable.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_variable.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_non_any_variable.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_null_values.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_null_values.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_null_values.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_null_values.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_null_variable.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_null_variable.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_list_of_null_variable.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_list_of_null_variable.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_null_argument.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_null_argument.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_null_argument.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_null_argument.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_null_variable.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_null_variable.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_null_variable.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_null_variable.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_object_argument.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_object_argument.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_object_argument.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_object_argument.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_object_variable.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_object_variable.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_object_variable.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_object_variable.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_with_variable_on_subgraph.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_variable_on_subgraph.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_with_variable_on_subgraph.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_with_variable_on_subgraph.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_without_typename_in_argument.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_without_typename_in_argument.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_without_typename_in_argument.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_without_typename_in_argument.json diff --git a/ballerina-tests/tests/resources/expected_results/querying_entities_field_without_typename_in_variable.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_without_typename_in_variable.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/querying_entities_field_without_typename_in_variable.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/querying_entities_field_without_typename_in_variable.json diff --git a/ballerina-tests/tests/resources/expected_results/test_entities_resolver_returnig_error_for_unresolvable_entity.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returnig_error_for_unresolvable_entity.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/test_entities_resolver_returnig_error_for_unresolvable_entity.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returnig_error_for_unresolvable_entity.json diff --git a/ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_return_type.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_return_type.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_return_type.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_return_type.json diff --git a/ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_typename.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_typename.json similarity index 100% rename from ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_typename.json rename to ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_error_for_invalid_typename.json diff --git a/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_null_value.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_null_value.json new file mode 100644 index 000000000..b81c62da0 --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_entities_resolver_returning_null_value.json @@ -0,0 +1 @@ +{ "data": { "_entities": [null] } } diff --git a/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json new file mode 100644 index 000000000..bff5f7049 --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json @@ -0,0 +1,7 @@ +{ + "data": { + "_entities": [ + { "__typename": "ProductData", "id": "1", "reviews": [{ "id": "123" }] } + ] + } +} diff --git a/ballerina-tests/graphql-subgraph-test-suite/values.bal b/ballerina-tests/graphql-subgraph-test-suite/values.bal new file mode 100644 index 000000000..9295e609b --- /dev/null +++ b/ballerina-tests/graphql-subgraph-test-suite/values.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +final readonly & StarInfo[] stars = [ + {name: "Absolutno*", constellation: "Lynx", designation: "XO-5"}, + {name: "Acamar", constellation: "Eridanus", designation: "θ1 Eridani A"}, + {name: "Achernar", constellation: "Eridanus", designation: "α Eridani A"} +]; + +final readonly & Planet[] planets = [ + {id: 1, name: "Mercury", mass: 0.383, numberOfMoons: 0}, + {id: 2, name: "Venus", mass: 0.949, numberOfMoons: 0}, + {id: 3, name: "Earth", mass: 1, numberOfMoons: 1, moon: {name: "moon"}} +]; diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal b/ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal new file mode 100644 index 000000000..c2c1974eb --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal @@ -0,0 +1,616 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscription() returns error? { + string document = string `subscription { name }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {name: "Walter"}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {name: "Skyler"}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionWithoutSubProtocol() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:Client|error wsClient = new (url); + string expectedErrorMsg = "InvalidHandshakeError: Invalid handshake response getStatus: 400 Bad Request"; + test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); + test:assertEquals((wsClient).message(), expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionsWithMultipleOperations() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_multiple_operations"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "getMessages"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "getStringMessages"); + + json expectedMsgPayload = {data: null}; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + foreach int i in 1 ..< 4 { + expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + expectedMsgPayload = {data: {stringMessages: i.toString()}}; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } + string httpUrl = "http://localhost:9091/subscriptions"; + json actualPayload = check common:getJsonPayloadFromService(httpUrl, document, operationName = "getName"); + json expectedPayload = {data: {name: "Walter White"}}; + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["records", "subscriptions"] +} +isolated function testSubscriptionWithRecords() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_records"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testQueryWithSameSubscriptionFieldName() returns error? { + string document = string `query { name }`; + string url = "http://localhost:9091/subscriptions"; + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = {data: {name: "Walter White"}}; + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["fragments", "subscriptions"] +} +isolated function testSubscriptionWithFragments() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_fragments"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["union", "subscriptions"] +} +isolated function testSubscriptionWithUnionType() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_union_type"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {multipleValues: {id: 1, name: "Jesse Pinkman"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {multipleValues: {name: "Walter White", subject: "Chemistry"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["variables", "subscriptions"] +} +isolated function testSubscriptionWithVariables() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_variable_values"); + json variables = {"value": 4}; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, variables = variables); + + foreach int i in 1 ..< 3 { + json expectedMsgPayload = {data: {filterValues: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + } +} + +@test:Config { + groups: ["introspection", "typename", "subscriptions"] +} +isolated function testSubscriptionWithIntrospectionInFields() returns error? { + string document = string `subscription { students { __typename } }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {students: {__typename: "StudentService"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testInvalidSubscription() returns error? { + string document = string `subscription { invalidField }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = check common:getJsonContentFromFile("subscription_invalid_field"); + check common:validateErrorMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionFunctionWithErrors() returns error? { + string document = string `subscription getNames { values }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedErrorPayload = [ + { + message: "{ballerina/lang.array}IndexOutOfRange", + locations: [{line: 1, column: 25}], + path: ["values"] + } + ]; + check common:validateErrorMessage(wsClient, expectedErrorPayload); +} + +@test:Config { + groups: ["service", "subscriptions"] +} +isolated function testSubscriptionWithServiceObjects() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + check common:validateCompleteMessage(wsClient); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionWithMultipleClients() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + foreach int i in 1 ..< 6 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } + check common:validateCompleteMessage(wsClient1, id = "1"); + check common:validateCompleteMessage(wsClient2, id = "2"); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testConnectionInitMessage() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:sendConnectionInitMessage(wsClient); + check common:validateConnectionAckMessage(wsClient); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testInvalidMultipleConnectionInitMessages() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendConnectionInitMessage(wsClient); + + string expectedErrorMsg = "Too many initialisation requests: Status code: 4429"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testUnauthorizedAccess() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:sendSubscriptionMessage(wsClient, document); + + string expectedErrorMsg = "Unauthorized: Status code: 4401"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +function testAlreadyExistingSubscriber() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + string clientId = wsClient.getConnectionId(); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, clientId); + check common:sendSubscriptionMessage(wsClient, document, clientId); + string expectedErrorMsg = "Subscriber for " + clientId + " already exists: Status code: 4409"; + int i = 0; + json|error response; + while true { + i += 1; + response = common:readMessageExcludingPingMessages(wsClient); + if response is error { + break; + } + if i > 3 { + test:assertFail(string `Expected: ${expectedErrorMsg}, Found: ${response.toString()}`); + } + json|error id = response.id; + if id is error { + test:assertFail(string `Expected json with id found: ${response.toString()}`); + } + } + test:assertEquals((response).message(), expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testOnPing() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check wsClient->writeMessage({'type: common:WS_PING}); + json response = check wsClient->readMessage(); + test:assertEquals(response.'type, common:WS_PONG); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testInvalidSubProtocolInSubscriptions() returns error? { + string url = "ws://localhost:9091/subscriptions"; + string subProtocol = "graphql-invalid-ws"; + websocket:ClientConfiguration config = {subProtocols: [subProtocol]}; + websocket:Client|error wsClient = new (url, config); + test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); + string expectedErrorMsg = "InvalidHandshakeError: Invalid subprotocol. Actual: null." + + " Expected one of: graphql-invalid-ws"; + test:assertEquals((wsClient).message(), expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions", "runtime_errors"] +} +isolated function testErrorsInStreams() returns error? { + string document = "subscription { evenNumber }"; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {evenNumber: 2}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = check common:getJsonContentFromFile("errors_in_streams"); + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {evenNumber: 6}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testMultipleSubscriptionUsingSingleClient() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + + check common:sendSubscriptionMessage(wsClient, document, "1"); + foreach int i in 1 ..< 6 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload, id = "1"); + } + check common:validateCompleteMessage(wsClient, id = "1"); + + check common:sendSubscriptionMessage(wsClient, document, "2"); + foreach int i in 1 ..< 6 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload, id = "2"); + } + check common:validateCompleteMessage(wsClient, id = "2"); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionWithInvalidPayload() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json invalidPayload = {'type: "start"}; + check wsClient->writeMessage(invalidPayload); + + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions", "recrods", "service"] +} +isolated function testResolverReturingStreamOfRecordsWithServiceObjects() returns error? { + string document = "subscription { live { product { id } score } }"; + string url = "ws://localhost:9092/reviews"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedPayload = {data: {live: {product: {id: "1"}, score: 20}}}; + check common:validateNextMessage(wsClient, expectedPayload); +} + +@test:Config { + groups: ["subscriptions", "recrods", "service", "maps"] +} +isolated function testResolverReturingStreamOfRecordsWithMapOfServiceObjects() returns error? { + string document = string `subscription { accountUpdates { details(key: "acc1") { name } } }`; + string url = "ws://localhost:9092/reviews"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {accountUpdates: {details: {name: "James"}}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {accountUpdates: {details: {name: "James Deen"}}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions", "multiplexing"] +} +isolated function testSubscriptionMultiplexing() returns error? { + string document = string `subscription { refresh }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, "1"); + check common:sendSubscriptionMessage(wsClient, document, "2"); + + boolean subscriptionOneDisabled = false; + map subscriptions = {"1": 0, "2": 0}; + while true { + json actualPayload = check common:readMessageExcludingPingMessages(wsClient); + string subscriptionId = check actualPayload.id; + subscriptions[subscriptionId] = subscriptions.get(subscriptionId) + 1; + if subscriptionOneDisabled && subscriptionId == "1" { + test:assertFail("Subscription one already unsubscirbed. No further data should be sent by ther server."); + } + if subscriptionId == "1" && subscriptions.get(subscriptionId) == 3 { + subscriptionOneDisabled = true; + check wsClient->writeMessage({'type: common:WS_COMPLETE, id: subscriptionId}); + } + if subscriptionId == "2" && subscriptions.get(subscriptionId) == 10 { + check wsClient->writeMessage({'type: common:WS_COMPLETE, id: subscriptionId}); + break; + } + json payload = {data: {refresh: "data"}}; + json expectedPayload = {'type: common:WS_NEXT, id: subscriptionId, payload: payload}; + test:assertEquals(actualPayload, expectedPayload); + } +} + +@test:Config { + groups: ["subscriptions", "recrods", "service"] +} +isolated function testConnectionClousureWhenPongNotRecived() returns error? { + string url = "ws://localhost:9092/reviews"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json|error response; + while true { + response = wsClient->readMessage(); + if response is json { + test:assertTrue(response.'type == common:WS_PING); + continue; + } + break; + } + test:assertTrue(response is error, "Expected connection clousure error"); + test:assertEquals((response).message(), "Request timeout: Status code: 4408"); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketRequestWithEmptyQuery() returns error? { + string document = ""; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + json expectedMsgPayload = {errors: [{message: "An empty query is found"}]}; + check common:validateErrorMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json payload = {query: 2}; + check wsClient->writeMessage({"type": common:WS_SUBSCRIBE, id: "1", payload: payload}); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketRequestWithoutQuery() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check wsClient->writeMessage({"type": common:WS_SUBSCRIBE, id: "1", payload: {}}); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidVariableInWebSocketPayload() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_variable_values"); + json variables = []; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, variables = variables); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testEmptyWebSocketPayload() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + string payload = ""; + check wsClient->writeMessage(payload); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketPayload() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:Client wsClient = check new (url, {subProtocols: [GRAPHQL_TRANSPORT_WS]}); + json payload = {payload: {query: ()}}; + check wsClient->writeMessage(payload); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["listener", "subscriptions"] +} +function testAttachServiceWithSubscriptionToHttp2BasedListener() returns error? { + graphql:Error? result = http2BasedListener.attach(subscriptionService); + test:assertTrue(result is graphql:Error); + graphql:Error err = result; + string expecctedMessage = string `Websocket listener initialization failed due to the incompatibility of ` + + string `provided HTTP(version 2.0) listener`; + test:assertEquals(err.message(), expecctedMessage); +} + +@test:Config { + groups: ["listener", "subscriptions"] +} +function testAttachServiceWithSubscriptionToHttp1BasedListener() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9092/service_with_http1"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal b/ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal new file mode 100644 index 000000000..5bb1a8c1c --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal @@ -0,0 +1,65 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["context", "subscriptions"] +} +isolated function testContextWithSubscriptions() returns error? { + string url = "ws://localhost:9092/context"; + string document = string `subscription { messages }`; + websocket:ClientConfiguration configs = { + customHeaders: { + "scope": "admin" + }, + subProtocols: [GRAPHQL_TRANSPORT_WS] + }; + websocket:Client wsClient = check new (url, configs); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + } +} + +@test:Config { + groups: ["context", "subscriptions"] +} +isolated function testContextWithInvalidScopeInSubscriptions() returns error? { + string url = "ws://localhost:9092/context"; + string document = string `subscription { messages }`; + websocket:ClientConfiguration configs = { + customHeaders: { + "scope": "user" + }, + subProtocols: [GRAPHQL_TRANSPORT_WS] + }; + websocket:Client wsClient = check new (url, configs); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + json expectedErrorPayload = [ + { + message: "You don't have permission to retrieve data", + locations: [{line: 1, column: 16}], + path: ["messages"] + } + ]; + check common:validateErrorMessage(wsClient, expectedErrorPayload); +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal b/ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal new file mode 100644 index 000000000..b60bfb8d5 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal @@ -0,0 +1,53 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["constraints", "subscriptions"] +} +isolated function testSubscriptionWithConstraints() returns error? { + string document = check common:getGraphqlDocumentFromFile("constraints"); + string url = "ws://localhost:9091/constraints"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, operationName = "Sub"); + json expectedMsgPayload = check common:getJsonContentFromFile("constraints_with_subscription"); + check common:validateErrorMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["constraints", "subscriptions"] +} +isolated function testMultipleSubscriptionClientsWithConstraints() returns error? { + string document = check common:getGraphqlDocumentFromFile("constraints"); + string url = "ws://localhost:9091/constraints"; + websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "Sub"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "Sub"); + + json expectedMsgPayload = check common:getJsonContentFromFile("constraints_with_subscription"); + check common:validateErrorMessage(wsClient1, expectedMsgPayload, "1"); + check common:validateErrorMessage(wsClient2, expectedMsgPayload, "2"); +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal new file mode 100644 index 000000000..b9fc1c816 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal @@ -0,0 +1,26 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +listener http:Listener http2Listener = new http:Listener(9090); +listener graphql:Listener http2BasedListener = new (http2Listener); + +listener graphql:Listener subscriptionListener = new (9091); + +listener http:Listener httpListener = new (9092, httpVersion = http:HTTP_1_1); +listener graphql:Listener wrappedListener = new (httpListener); diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal new file mode 100644 index 000000000..e422adf8d --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal @@ -0,0 +1,161 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/lang.runtime; + +public type PeopleService StudentService|TeacherService; + +public distinct isolated service class StudentService { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } +} + +public distinct isolated service class TeacherService { + private final int id; + private string name; + private string subject; + + public isolated function init(int id, string name, string subject) { + self.id = id; + self.name = name; + self.subject = subject; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + isolated function setName(string name) { + lock { + self.name = name; + } + } + + isolated resource function get subject() returns string { + lock { + return self.subject; + } + } + + isolated function setSubject(string subject) { + lock { + self.subject = subject; + } + } + + isolated resource function get holidays() returns Weekday[] { + return [SATURDAY, SUNDAY]; + } + + isolated resource function get school() returns School { + return new School("CHEM"); + } +} + +class EvenNumberGenerator { + private int i = 0; + + public isolated function next() returns record {|int value;|}|error? { + self.i += 2; + if self.i == 4 { + return error("Runtime exception"); + } + if self.i > 6 { + return; + } + return {value: self.i}; + } +} + +class RefreshData { + public isolated function next() returns record {|string value;|}? { + // emit data every one second + runtime:sleep(1); + return {value: "data"}; + } +} + +public distinct isolated service class School { + private string name; + + public isolated function init(string name) { + self.name = name; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + # Get the opening days of the school. + # + return - The set of the weekdays the school is open + # # Deprecated + # School is now online. + @deprecated + isolated resource function get openingDays() returns Weekday[] { + return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; + } +} + +public service class AccountDetails { + final string name; + final int createdYear; + + function init(string name, int createdYear) { + self.name = name; + self.createdYear = createdYear; + } + + resource function get name() returns string { + return self.name; + } + + resource function get createdYear() returns int { + return self.createdYear; + } +} + +public service class Product { + private final string id; + + function init(string id) { + self.id = id; + } + + resource function get id() returns string { + return self.id; + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/records.bal b/ballerina-tests/graphql-subscription-test-suite/tests/records.bal new file mode 100644 index 000000000..41377d84f --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/records.bal @@ -0,0 +1,78 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/constraint; + +public type MovieDetails record {| + @constraint:String { + minLength: 1, + maxLength: 10 + } + string name; + + @constraint:Int { + minValue: 18 + } + int downloads; + + @constraint:Float { + minValue: 1.5 + } + float imdb; + + @constraint:Array { + length: 1 + } + Reviews?[] reviews; +|}; + +public type Reviews readonly & record {| + @constraint:Array { + maxLength: 2 + } + string[] comments; + + @constraint:Int { + minValueExclusive: 0, + maxValueExclusive: 6 + } + int stars; +|}; + +public type Review record {| + Product product; + int score; + string description; +|}; + +public type AccountRecords record {| + map details; +|}; + +public type Book readonly & record { + string name; + string author; +}; + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/constraints.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/constraints.graphql new file mode 100644 index 000000000..f795d868e --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/constraints.graphql @@ -0,0 +1,12 @@ +subscription Sub { + movie( + movie: { + name: "Saving Private Ryan" + downloads: 12 + imdb: 1.0 + reviews: [] + } + ) { + stars + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_fragments.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_fragments.graphql new file mode 100644 index 000000000..e4eed7fab --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_fragments.graphql @@ -0,0 +1,14 @@ +subscription getStudents { + ...personFields +} + +fragment personFields on Subscription { + ...studentFields +} + +fragment studentFields on Subscription { + students { + id + name + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_multiple_operations.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_multiple_operations.graphql new file mode 100644 index 000000000..f99e1cbd8 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_multiple_operations.graphql @@ -0,0 +1,11 @@ +query getName { + name +} + +subscription getMessages { + messages +} + +subscription getStringMessages { + stringMessages +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_records.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_records.graphql new file mode 100644 index 000000000..c648ddcf1 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_records.graphql @@ -0,0 +1,6 @@ +subscription { + books { + name + author + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_service_objects.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_service_objects.graphql new file mode 100644 index 000000000..42210acb1 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_service_objects.graphql @@ -0,0 +1,6 @@ +subscription getStudents { + students { + id + name + } +} diff --git a/ballerina-tests/tests/resources/documents/subscriptions_with_union_type.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_union_type.graphql similarity index 51% rename from ballerina-tests/tests/resources/documents/subscriptions_with_union_type.graphql rename to ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_union_type.graphql index 8f2e7b97b..1b2ded7a2 100644 --- a/ballerina-tests/tests/resources/documents/subscriptions_with_union_type.graphql +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_union_type.graphql @@ -1,16 +1,16 @@ subscription unionTypes { - multipleValues { - ...StudentFragment - ...TeacherFragment - } + multipleValues { + ...StudentFragment + ...TeacherFragment + } } fragment StudentFragment on StudentService { - id - name + id + name } fragment TeacherFragment on TeacherService { - name - subject + name + subject } diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_variable_values.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_variable_values.graphql new file mode 100644 index 000000000..b8dad85e7 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/subscriptions_with_variable_values.graphql @@ -0,0 +1,3 @@ +subscription getFilteredValues($value: Int!) { + filterValues(value: $value) +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/constraints_with_subscription.json b/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/constraints_with_subscription.json new file mode 100644 index 000000000..8ed90d70d --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/constraints_with_subscription.json @@ -0,0 +1,12 @@ +[ + { + "message": "Input validation failed in the field \"movie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", + "locations": [ + { + "line": 2, + "column": 3 + } + ], + "path": ["movie"] + } +] diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/errors_in_streams.json b/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/errors_in_streams.json new file mode 100644 index 000000000..6b3dc287f --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/errors_in_streams.json @@ -0,0 +1,15 @@ +{ + "errors": [ + { + "message": "Runtime exception", + "locations": [ + { + "line": 1, + "column": 16 + } + ], + "path": ["evenNumber"] + } + ], + "data": null +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/subscription_invalid_field.json b/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/subscription_invalid_field.json new file mode 100644 index 000000000..cdf21cc2a --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/resources/expected_results/subscription_invalid_field.json @@ -0,0 +1,8 @@ +{ + "errors": [ + { + "message": "Cannot query field \"invalidField\" on type \"Subscription\".", + "locations": [{ "line": 1, "column": 16 }] + } + ] +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/tests/services.bal new file mode 100644 index 000000000..9bf03999c --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/services.bal @@ -0,0 +1,156 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +service /subscriptions on subscriptionListener { + isolated resource function get name() returns string { + return "Walter White"; + } + + resource function subscribe name() returns stream { + return namesArray.toStream(); + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } + + isolated resource function subscribe stringMessages() returns stream { + string?[] stringArray = [(), "1", "2", "3", "4", "5"]; + return stringArray.toStream(); + } + + isolated resource function subscribe books() returns stream { + Book[] books = [ + {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, + {name: "A Game of Thrones", author: "George R.R. Martin"} + ]; + return books.toStream(); + } + + isolated resource function subscribe students() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } + + isolated resource function subscribe filterValues(int value) returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + int[] filteredArray = []; + foreach int i in intArray { + if i < value { + filteredArray.push(i); + } + } + return filteredArray.toStream(); + } + + isolated resource function subscribe values() returns stream|error { + int[] array = []; + int _ = check trap array.remove(0); + return array.toStream(); + } + + isolated resource function subscribe multipleValues() returns stream<(PeopleService)>|error { + StudentService s = new StudentService(1, "Jesse Pinkman"); + TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); + return [s, t].toStream(); + } + + isolated resource function subscribe evenNumber() returns stream { + EvenNumberGenerator evenNumberGenerator = new; + return new (evenNumberGenerator); + } + + isolated resource function subscribe refresh() returns stream { + RefreshData dataRefersher = new; + return new (dataRefersher); + } +} + +service /reviews on wrappedListener { + resource function get greet() returns string { + return "Welcome!"; + } + + resource function subscribe live() returns stream { + return reviews.toArray().toStream(); + } + + resource function subscribe accountUpdates() returns stream { + map details = {acc1: new AccountDetails("James", 2022), acc2: new AccountDetails("Paul", 2015)}; + map updatedDetails = {...details}; + updatedDetails["acc1"] = new AccountDetails("James Deen", 2022); + return [{details}, {details: updatedDetails}].toStream(); + } +} + +graphql:Service subscriptionService = service object { + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +}; + +isolated service /service_with_http1 on wrappedListener { + isolated resource function get greet() returns string { + return "welcome!"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + contextInit: + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("scope", check request.getHeader("scope")); + return context; + } +} +service /context on wrappedListener { + isolated resource function get greet() returns string { + return "welcome!"; + } + + isolated resource function subscribe messages(graphql:Context context) returns stream|error { + var scope = context.get("scope"); + if scope is string && scope == "admin" { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } + return error("You don't have permission to retrieve data"); + } +} + +service /constraints on subscriptionListener { + isolated resource function get greet() returns string { + return "welcome!"; + } + + isolated resource function subscribe movie(MovieDetails movie) returns stream { + return movie.reviews.toStream(); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/values.bal b/ballerina-tests/graphql-subscription-test-suite/tests/values.bal new file mode 100644 index 000000000..fbcb22680 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/tests/values.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; + +table reviews = table [ + {product: new ("1"), score: 20, description: "Product 01"}, + {product: new ("2"), score: 20, description: "Product 02"}, + {product: new ("3"), score: 20, description: "Product 03"}, + {product: new ("4"), score: 20, description: "Product 04"}, + {product: new ("5"), score: 20, description: "Product 05"} +]; + +public string[] namesArray = ["Walter", "Skyler"]; diff --git a/ballerina-tests/graphql-test-common/Package.md b/ballerina-tests/graphql-test-common/Package.md new file mode 100644 index 000000000..938c19760 --- /dev/null +++ b/ballerina-tests/graphql-test-common/Package.md @@ -0,0 +1,3 @@ +## Package Overview + +This package provides APIs for testing the Ballerina GraphQL module. diff --git a/ballerina-tests/graphql-test-common/constants.bal b/ballerina-tests/graphql-test-common/constants.bal new file mode 100644 index 000000000..a2d6ec0bc --- /dev/null +++ b/ballerina-tests/graphql-test-common/constants.bal @@ -0,0 +1,29 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public const CONTENT_TYPE_TEXT_HTML = "text/html"; +public const CONTENT_TYPE_TEXT_PLAIN = "text/plain"; +public const CONTENT_TYPE_APPLICATION_JSON = "application/json"; + +// WebSocket Message types +public const WS_INIT = "connection_init"; +public const WS_ACK = "connection_ack"; +public const WS_PING = "ping"; +public const WS_PONG = "pong"; +public const WS_SUBSCRIBE = "subscribe"; +public const WS_NEXT = "next"; +public const WS_ERROR = "error"; +public const WS_COMPLETE = "complete"; diff --git a/ballerina-tests/tests/utils.bal b/ballerina-tests/graphql-test-common/utils.bal similarity index 52% rename from ballerina-tests/tests/utils.bal rename to ballerina-tests/graphql-test-common/utils.bal index 085d1848f..1cba953d5 100644 --- a/ballerina-tests/tests/utils.bal +++ b/ballerina-tests/graphql-test-common/utils.bal @@ -21,18 +21,14 @@ import ballerina/io; import ballerina/test; import ballerina/websocket; -const CONTENT_TYPE_TEXT_HTML = "text/html"; -const CONTENT_TYPE_TEXT_PLAIN = "text/plain"; -const CONTENT_TYPE_APPLICATION_JSON = "application/json"; - -isolated function getJsonPayloadUsingHttpClient(string url, string document, json? variables = {}, string? operationName = (), - http:HttpVersion httpVersion = http:HTTP_1_1) returns json|error { - http:Client httpClient = check new(url, httpVersion = httpVersion); - return httpClient->post("/", { query: document, operationName: operationName, variables: variables}); +public isolated function getJsonPayloadUsingHttpClient(string url, string document, json? variables = {}, string? operationName = (), + http:HttpVersion httpVersion = http:HTTP_1_1) returns json|error { + http:Client httpClient = check new (url, httpVersion = httpVersion); + return httpClient->post("/", {query: document, operationName: operationName, variables: variables}); } -isolated function getJsonPayloadFromService(string url, string document, json variables = (), string? operationName = (), - map? headers = ()) returns json|error { +public isolated function getJsonPayloadFromService(string url, string document, json variables = (), string? operationName = (), + map? headers = ()) returns json|error { graphql:Client graphqlClient = check new (url); json|graphql:ClientError response = graphqlClient->execute(document, ?>variables, operationName, headers); if response is graphql:InvalidDocumentError { @@ -46,62 +42,64 @@ isolated function getJsonPayloadFromService(string url, string document, json va } } -isolated function getTextPayloadFromService(string url, string document, json? variables = {}, string? operationName = ()) +public isolated function getTextPayloadFromService(string url, string document, json? variables = {}, string? operationName = ()) returns string|error { - http:Client httpClient = check new(url, httpVersion = http:HTTP_1_1); - http:Response response = check httpClient->post("/", { query: document, operationName: operationName, variables: variables}); + http:Client httpClient = check new (url, httpVersion = http:HTTP_1_1); + http:Response response = check httpClient->post("/", {query: document, operationName: operationName, variables: variables}); return response.getTextPayload(); } -isolated function getJsonPayloadFromRequest(string url, http:Request request) returns json|error { - http:Client httpClient = check new(url, httpVersion = http:HTTP_1_1); +public isolated function getJsonPayloadFromRequest(string url, http:Request request) returns json|error { + http:Client httpClient = check new (url, httpVersion = http:HTTP_1_1); return httpClient->post("/", request); } -isolated function getJsonContentFromFile(string fileName) returns json|error { +public isolated function getJsonContentFromFile(string fileName) returns json|error { string jsonFileName = string `${fileName}.json`; string path = check file:joinPath("tests", "resources", "expected_results", jsonFileName); - return io:fileReadJson(path); + json content = check io:fileReadJson(path); + return content; } -isolated function getGraphqlDocumentFromFile(string fileName) returns string|error { +public isolated function getGraphqlDocumentFromFile(string fileName) returns string|error { string gqlFileName = string `${fileName}.graphql`; string path = check file:joinPath("tests", "resources", "documents", gqlFileName); - return io:fileReadString(path); + string content = check io:fileReadString(path); + return content; } -isolated function assertResponseAndGetPayload(string url, string document, json? variables = {}, -string? operationName = (), int statusCode = http:STATUS_OK) returns json|error { - http:Client httpClient = check new(url, httpVersion = http:HTTP_1_1); - http:Response response = check httpClient->post("/", { query: document, operationName: operationName, variables: variables}); +public isolated function assertResponseAndGetPayload(string url, string document, json? variables = {}, + string? operationName = (), int statusCode = http:STATUS_OK) returns json|error { + http:Client httpClient = check new (url, httpVersion = http:HTTP_1_1); + http:Response response = check httpClient->post("/", {query: document, operationName: operationName, variables: variables}); test:assertEquals(response.statusCode, statusCode); return response.getJsonPayload(); } -isolated function getTextPayloadFromBadRequest(string url, http:Request request) returns string|error { - http:Client httpClient = check new(url, httpVersion = http:HTTP_1_1); +public isolated function getTextPayloadFromBadRequest(string url, http:Request request) returns string|error { + http:Client httpClient = check new (url, httpVersion = http:HTTP_1_1); http:Response response = check httpClient->post("/", request); assertResponseForBadRequest(response); return response.getTextPayload(); } -isolated function assertResponseForBadRequest(http:Response response) { +public isolated function assertResponseForBadRequest(http:Response response) { int statusCode = response.statusCode; if statusCode != http:STATUS_BAD_REQUEST && statusCode != http:STATUS_NOT_FOUND { - test:assertFail(string`Invalid status code received: ${statusCode}`); + test:assertFail(string `Invalid status code received: ${statusCode}`); } } -isolated function assertJsonValuesWithOrder(json actualPayload, json expectedPayload) { +public isolated function assertJsonValuesWithOrder(json actualPayload, json expectedPayload) { string actual = actualPayload.toJsonString(); string expected = expectedPayload.toJsonString(); test:assertEquals(actual, expected); } -isolated function getContentFromByteStream(stream byteStream) returns string|error { - record {| byte[] value; |}|io:Error? next = byteStream.iterator().next(); +public isolated function getContentFromByteStream(stream byteStream) returns string|error { + record {|byte[] value;|}|io:Error? next = byteStream.iterator().next(); byte[] content = []; - while next is record {| byte[] value; |} { + while next is record {|byte[] value;|} { foreach byte b in next.value { content.push(b); } @@ -110,13 +108,13 @@ isolated function getContentFromByteStream(stream byteStream) return 'string:fromBytes(content); } -isolated function readMessageExcludingPingMessages(websocket:Client wsClient) returns json|websocket:Error { +public isolated function readMessageExcludingPingMessages(websocket:Client wsClient) returns json|websocket:Error { json message = null; while true { message = check wsClient->readMessage(); if message == null { continue; - } + } if message.'type == WS_PING { check sendPongMessage(wsClient); continue; @@ -125,51 +123,51 @@ isolated function readMessageExcludingPingMessages(websocket:Client wsClient) re } } -isolated function sendPongMessage(websocket:Client wsClient) returns websocket:Error? { +public isolated function sendPongMessage(websocket:Client wsClient) returns websocket:Error? { json message = {'type: WS_PONG}; check wsClient->writeMessage(message); } -isolated function sendSubscriptionMessage(websocket:Client wsClient, string document, string id = "1", - json? variables = {}, string? operationName = ()) returns websocket:Error? { +public isolated function sendSubscriptionMessage(websocket:Client wsClient, string document, string id = "1", + json? variables = {}, string? operationName = ()) returns websocket:Error? { json payload = {query: document, variables: variables, operationName: operationName}; json wsPayload = {'type: WS_SUBSCRIBE, id: id, payload: payload}; return wsClient->writeMessage(wsPayload); } -isolated function validateConnectionAckMessage(websocket:Client wsClient) returns websocket:Error? { +public isolated function validateConnectionAckMessage(websocket:Client wsClient) returns websocket:Error? { json response = check wsClient->readMessage(); test:assertEquals(response.'type, WS_ACK); } -isolated function sendConnectionInitMessage(websocket:Client wsClient) returns websocket:Error? { +public isolated function sendConnectionInitMessage(websocket:Client wsClient) returns websocket:Error? { check wsClient->writeMessage({'type: WS_INIT}); } -isolated function initiateGraphqlWsConnection(websocket:Client wsClient) returns websocket:Error? { +public isolated function initiateGraphqlWsConnection(websocket:Client wsClient) returns websocket:Error? { check sendConnectionInitMessage(wsClient); check validateConnectionAckMessage(wsClient); } -isolated function validateNextMessage(websocket:Client wsClient, json expectedMsgPayload, string id = "1") returns websocket:Error? { +public isolated function validateNextMessage(websocket:Client wsClient, json expectedMsgPayload, string id = "1") returns websocket:Error? { json expectedPayload = {'type: WS_NEXT, id, payload: expectedMsgPayload}; json actualPayload = check readMessageExcludingPingMessages(wsClient); assertJsonValuesWithOrder(actualPayload, expectedPayload); } -isolated function validateErrorMessage(websocket:Client wsClient, json expectedMsgPayload, string id = "1") returns websocket:Error? { +public isolated function validateErrorMessage(websocket:Client wsClient, json expectedMsgPayload, string id = "1") returns websocket:Error? { json expectedPayload = {'type: WS_ERROR, id, payload: expectedMsgPayload}; json actualPayload = check readMessageExcludingPingMessages(wsClient); assertJsonValuesWithOrder(actualPayload, expectedPayload); } -isolated function validateCompleteMessage(websocket:Client wsClient, string id = "1") returns websocket:Error? { +public isolated function validateCompleteMessage(websocket:Client wsClient, string id = "1") returns websocket:Error? { json expectedPayload = {'type: WS_COMPLETE, id}; json actualPayload = check readMessageExcludingPingMessages(wsClient); assertJsonValuesWithOrder(actualPayload, expectedPayload); } -isolated function validateConnectionClousureWithError(websocket:Client wsClient, string expectedErrorMsg) { +public isolated function validateConnectionClousureWithError(websocket:Client wsClient, string expectedErrorMsg) { json|error response = readMessageExcludingPingMessages(wsClient); if response is error { test:assertEquals(response.message(), expectedErrorMsg); diff --git a/ballerina-tests/tests/02_request_validation.bal b/ballerina-tests/tests/02_request_validation.bal deleted file mode 100644 index 96af921ba..000000000 --- a/ballerina-tests/tests/02_request_validation.bal +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; -import ballerina/test; -import ballerina/url; -import ballerina/websocket; - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testMultipleOperationsWithoutOperationNameInRequest() returns error? { - string document = check getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); - string url = "http://localhost:9091/records"; - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = { - errors: [ - { - message: "Must provide operation name if query contains multiple operations.", - locations: [] - } - ] - }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testMultipleOperationsWithInvalidOperationInRequest() returns error? { - string document = check getGraphqlDocumentFromFile("multiple_operations_without_operation_name_in_request"); - string url = "http://localhost:9091/records"; - json actualPayload = check getJsonPayloadFromService(url, document, operationName = "invalid"); - json expectedPayload = { - errors: [ - { - message: "Unknown operation named \"invalid\".", - locations: [] - } - ] - }; - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testInvalidGetRequestWithoutQuery() returns error? { - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); - http:Response response = check httpClient->get("/records"); - assertResponseForBadRequest(response); - test:assertEquals(response.getTextPayload(), "Query not found"); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testGetRequest() returns error? { - string document = "query getDetective{ detective { name }}"; - string encodedDocument = check url:encode(document, "UTF-8"); - json expectedPayload = { - data: { - detective: { - name: "Sherlock Holmes" - } - } - }; - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); - string path = "/records?query=" + encodedDocument; - json actualPayload = check httpClient->get(path); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testGetRequestWithEmptyQuery() returns error? { - http:Client httpClient = check new("http://localhost:9091", httpVersion = "1.1"); - string path = "/records?query="; - http:Response response = check httpClient->get(path); - assertResponseForBadRequest(response); - test:assertEquals(response.getTextPayload(), "Query not found"); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testInvalidJsonPayload() returns error? { - http:Request request = new; - request.setJsonPayload({}); - string payload = check getTextPayloadFromBadRequest("http://localhost:9091/records", request); - test:assertEquals(payload, "Invalid request body"); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testEmptyStringAsQuery() returns error? { - http:Request request = new; - request.setJsonPayload({ query: "" }); - string payload = check getTextPayloadFromBadRequest("http://localhost:9091/records", request); - test:assertEquals(payload, "Invalid request body"); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testInvalidContentType() returns error? { - http:Request request= new; - request.setPayload("invalid"); - string payload = check getTextPayloadFromBadRequest("http://localhost:9091/records", request); - test:assertEquals(payload, "Invalid 'Content-type' received"); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testContentTypeGraphql() returns error? { - http:Request request = new; - request.setHeader("Content-Type", "application/graphql"); - string payload = check getTextPayloadFromBadRequest("http://localhost:9091/records", request); - test:assertEquals(payload, "Content-Type 'application/graphql' is not yet supported"); -} - -@test:Config { - groups: ["request_validation", "listener"] -} -isolated function testInvalidRequestBody() returns error? { - http:Request request = new; - request.setTextPayload("Invalid"); - request.setHeader("Content-Type", "application/json"); - string payload = check getTextPayloadFromBadRequest("http://localhost:9091/records", request); - test:assertEquals(payload, "Invalid request body"); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketRequestWithEmptyQuery() returns error? { - string document = ""; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - json expectedMsgPayload = {errors: [{message: "An empty query is found"}]}; - check validateErrorMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - json payload = {query: 2}; - check wsClient->writeMessage({"type": WS_SUBSCRIBE, id: "1", payload: payload}); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketRequestWithoutQuery() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check wsClient->writeMessage({"type": WS_SUBSCRIBE, id: "1", payload: {}}); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidVariableInWebSocketPayload() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_variable_values"); - json variables = []; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document, variables = variables); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testEmptyWebSocketPayload() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - string payload = ""; - check wsClient->writeMessage(payload); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketPayload() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:Client wsClient = check new (url, {subProtocols: [GRAPHQL_TRANSPORT_WS]}); - json payload = {payload: {query: ()}}; - check wsClient->writeMessage(payload); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" - + " 'graphql-transport-ws' subprotocol: Status code: 1003"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} diff --git a/ballerina-tests/tests/36_subscriptions.bal b/ballerina-tests/tests/36_subscriptions.bal deleted file mode 100644 index 30a8b4f34..000000000 --- a/ballerina-tests/tests/36_subscriptions.bal +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/test; -import ballerina/websocket; - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscription() returns error? { - string document = string `subscription { name }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {name: "Walter"}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {name: "Skyler"}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionWithoutSubProtocol() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:Client|error wsClient = new (url); - string expectedErrorMsg = "InvalidHandshakeError: Invalid handshake response getStatus: 400 Bad Request"; - test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); - test:assertEquals((wsClient).message(), expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionsWithMultipleOperations() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_multiple_operations"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1", operationName = "getMessages"); - - websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2", operationName = "getStringMessages"); - - json expectedMsgPayload = {data: null}; - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - foreach int i in 1 ..< 4 { - expectedMsgPayload = {data: {messages: i}}; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - expectedMsgPayload = {data: {stringMessages: i.toString()}}; - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } - string httpUrl = "http://localhost:9099/subscriptions"; - json actualPayload = check getJsonPayloadFromService(httpUrl, document, operationName = "getName"); - json expectedPayload = {data: {name: "Walter White"}}; - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["records", "subscriptions"] -} -isolated function testSubscriptionWithRecords() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_records"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testQueryWithSameSubscriptionFieldName() returns error? { - string document = string `query { name }`; - string url = "http://localhost:9099/subscriptions"; - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = {data: {name: "Walter White"}}; - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["fragments", "subscriptions"] -} -isolated function testSubscriptionWithFragments() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_fragments"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["union", "subscriptions"] -} -isolated function testSubscriptionWithUnionType() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_union_type"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {multipleValues: {id: 1, name: "Jesse Pinkman"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {multipleValues: {name: "Walter White", subject: "Chemistry"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["variables", "subscriptions"] -} -isolated function testSubscriptionWithVariables() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_variable_values"); - json variables = {"value": 4}; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document, variables = variables); - - foreach int i in 1 ..< 3 { - json expectedMsgPayload = {data: {filterValues: i}}; - check validateNextMessage(wsClient, expectedMsgPayload); - } -} - -@test:Config { - groups: ["introspection", "typename", "subscriptions"] -} -isolated function testSubscriptionWithIntrospectionInFields() returns error? { - string document = string `subscription { students { __typename } }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {students: {__typename: "StudentService"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testInvalidSubscription() returns error? { - string document = string `subscription { invalidField }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = check getJsonContentFromFile("subscription_invalid_field"); - check validateErrorMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionFunctionWithErrors() returns error? { - string document = string `subscription getNames { values }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedErrorPayload = [ - { - message: "{ballerina/lang.array}IndexOutOfRange", - locations: [{line: 1, column: 25}], - path: ["values"] - } - ]; - check validateErrorMessage(wsClient, expectedErrorPayload); -} - -@test:Config { - groups: ["service", "subscriptions"] -} -isolated function testSubscriptionWithServiceObjects() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_service_objects"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; - check validateNextMessage(wsClient, expectedMsgPayload); - check validateCompleteMessage(wsClient); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionWithMultipleClients() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - - websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2"); - - foreach int i in 1 ..< 6 { - json expectedMsgPayload = {data: {messages: i}}; - check validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } - check validateCompleteMessage(wsClient1, id = "1"); - check validateCompleteMessage(wsClient2, id = "2"); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testConnectionInitMessage() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check sendConnectionInitMessage(wsClient); - check validateConnectionAckMessage(wsClient); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testInvalidMultipleConnectionInitMessages() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendConnectionInitMessage(wsClient); - - string expectedErrorMsg = "Too many initialisation requests: Status code: 4429"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testUnauthorizedAccess() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_service_objects"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check sendSubscriptionMessage(wsClient, document); - - string expectedErrorMsg = "Unauthorized: Status code: 4401"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -function testAlreadyExistingSubscriber() returns error? { - string document = check getGraphqlDocumentFromFile("subscriptions_with_service_objects"); - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - string clientId = wsClient.getConnectionId(); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document, clientId); - check sendSubscriptionMessage(wsClient, document, clientId); - string expectedErrorMsg = "Subscriber for " + clientId + " already exists: Status code: 4409"; - int i = 0; - json|error response; - while true { - i += 1; - response = readMessageExcludingPingMessages(wsClient); - if response is error { - break; - } - if i > 3 { - test:assertFail(string `Expected: ${expectedErrorMsg}, Found: ${response.toString()}`); - } - json|error id = response.id; - if id is error { - test:assertFail(string `Expected json with id found: ${response.toString()}`); - } - } - test:assertEquals((response).message(), expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testOnPing() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check wsClient->writeMessage({'type: WS_PING}); - json response = check wsClient->readMessage(); - test:assertEquals(response.'type, WS_PONG); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testInvalidSubProtocolInSubscriptions() returns error? { - string url = "ws://localhost:9099/subscriptions"; - string subProtocol = "graphql-invalid-ws"; - websocket:ClientConfiguration config = {subProtocols: [subProtocol]}; - websocket:Client|error wsClient = new (url, config); - test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); - string expectedErrorMsg = "InvalidHandshakeError: Invalid subprotocol. Actual: null." + - " Expected one of: graphql-invalid-ws"; - test:assertEquals((wsClient).message(), expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions", "runtime_errors"] -} -isolated function testErrorsInStreams() returns error? { - string document = "subscription { evenNumber }"; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {evenNumber: 2}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = check getJsonContentFromFile("errors_in_streams"); - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {evenNumber: 6}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testMultipleSubscriptionUsingSingleClient() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - - check sendSubscriptionMessage(wsClient, document, "1"); - foreach int i in 1 ..< 6 { - json expectedMsgPayload = {data: {messages: i}}; - check validateNextMessage(wsClient, expectedMsgPayload, id = "1"); - } - check validateCompleteMessage(wsClient, id = "1"); - - check sendSubscriptionMessage(wsClient, document, "2"); - foreach int i in 1 ..< 6 { - json expectedMsgPayload = {data: {messages: i}}; - check validateNextMessage(wsClient, expectedMsgPayload, id = "2"); - } - check validateCompleteMessage(wsClient, id = "2"); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionWithInvalidPayload() returns error? { - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - json invalidPayload = {'type: "start"}; - check wsClient->writeMessage(invalidPayload); - - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions", "recrods", "service"] -} -isolated function testResolverReturingStreamOfRecordsWithServiceObjects() returns error? { - string document = "subscription { live { product { id } score } }"; - string url = "ws://localhost:9090/reviews"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedPayload = {data: {live: {product: {id: "1"}, score: 20}}}; - check validateNextMessage(wsClient, expectedPayload); -} - -@test:Config { - groups: ["subscriptions", "recrods", "service", "maps"] -} -isolated function testResolverReturingStreamOfRecordsWithMapOfServiceObjects() returns error? { - string document = string `subscription { accountUpdates { details(key: "acc1") { name } } }`; - string url = "ws://localhost:9090/reviews"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {accountUpdates: {details: {name: "James"}}}}; - check validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {accountUpdates: {details: {name: "James Deen"}}}}; - check validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions", "multiplexing"] -} -isolated function testSubscriptionMultiplexing() returns error? { - string document = string `subscription { refresh }`; - string url = "ws://localhost:9099/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document, "1"); - check sendSubscriptionMessage(wsClient, document, "2"); - - boolean subscriptionOneDisabled = false; - map subscriptions = {"1": 0, "2": 0}; - while true { - json actualPayload = check readMessageExcludingPingMessages(wsClient); - string subscriptionId = check actualPayload.id; - subscriptions[subscriptionId] = subscriptions.get(subscriptionId) + 1; - if subscriptionOneDisabled && subscriptionId == "1" { - test:assertFail("Subscription one already unsubscirbed. No further data should be sent by ther server."); - } - if subscriptionId == "1" && subscriptions.get(subscriptionId) == 3 { - subscriptionOneDisabled = true; - check wsClient->writeMessage({'type: WS_COMPLETE, id: subscriptionId}); - } - if subscriptionId == "2" && subscriptions.get(subscriptionId) == 10 { - check wsClient->writeMessage({'type: WS_COMPLETE, id: subscriptionId}); - break; - } - json payload = {data: {refresh: "data"}}; - json expectedPayload = {'type: WS_NEXT, id: subscriptionId, payload: payload}; - test:assertEquals(actualPayload, expectedPayload); - } -} - -@test:Config { - groups: ["subscriptions", "recrods", "service"] -} -isolated function testConnectionClousureWhenPongNotRecived() returns error? { - string url = "ws://localhost:9090/reviews"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - json|error response; - while true { - response = wsClient->readMessage(); - if response is json { - test:assertTrue(response.'type == WS_PING); - continue; - } - break; - } - test:assertTrue(response is error, "Expected connection clousure error"); - test:assertEquals((response).message(), "Request timeout: Status code: 4408"); -} diff --git a/ballerina-tests/tests/42_constraint_validation.bal b/ballerina-tests/tests/42_constraint_validation.bal deleted file mode 100644 index da84683f5..000000000 --- a/ballerina-tests/tests/42_constraint_validation.bal +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/test; -import ballerina/websocket; - -@test:Config { - groups: ["constraints"], - dataProvider: dataProviderConstraintValidation -} -function testConstraintValidation(string url, string documentFileName, string jsonFileName, json variables = (), string? operationName = ()) returns error? { - string document = check getGraphqlDocumentFromFile(documentFileName); - json actualPayload = check getJsonPayloadFromService(url, document, variables = variables, operationName = operationName); - json expectedPayload = check getJsonContentFromFile(jsonFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -function dataProviderConstraintValidation() returns map<[string, string, string, json, string?]> { - - string url1 = "localhost:9091/constraints"; - string url2 = "localhost:9091/constraints_config"; - - json var1 = { - movie: { - name: "The Green Mile", - downloads: 12, - imdb: 1.0, - reviews: [] - } - }; - - json var2 = { - movies: [ - {name: "", downloads: 1, imdb: 0.5, reviews:[]}, - {name: "The Shawshank Redemption", downloads: 22, imdb: 9.2, reviews:[null]}, - {name: "Inception", downloads: 3, imdb: 8.7, reviews:[null]} - ] - }; - - map<[string, string, string, json, string?]> dataSet = - { - "1": [url1, "constraints", "constraints", (), "A"], - "2": [url1, "constraints", "constraints_with_mutation", (), "B"], - "3": [url1, "constraints", "constraints_with_intersection_types", (), "C"], - "4": [url1, "constraints", "constraints_with_list_type_inputs", (), "D"], - "5": [url1, "constraints", "constraints_with_variables_1", var1, "E"], - "6": [url1, "constraints", "constraints_with_variables_2", var2, "F"], - "7": [url2, "constraints", "constraints_configuration", (), "A"] - }; - return dataSet; -} - -@test:Config { - groups: ["constraints", "subscriptions"] -} -isolated function testSubscriptionWithConstraints() returns error? { - string document = check getGraphqlDocumentFromFile("constraints"); - string url = "ws://localhost:9091/constraints"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check initiateGraphqlWsConnection(wsClient); - check sendSubscriptionMessage(wsClient, document, operationName = "Sub"); - json expectedMsgPayload = check getJsonContentFromFile("constraints_with_subscription"); - check validateErrorMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["constraints", "subscriptions"] -} -isolated function testMultipleSubscriptionClientsWithConstraints() returns error? { - string document = check getGraphqlDocumentFromFile("constraints"); - string url = "ws://localhost:9091/constraints"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check initiateGraphqlWsConnection(wsClient1); - check sendSubscriptionMessage(wsClient1, document, "1", operationName = "Sub"); - - websocket:Client wsClient2 = check new (url, config); - check initiateGraphqlWsConnection(wsClient2); - check sendSubscriptionMessage(wsClient2, document, "2", operationName = "Sub"); - - json expectedMsgPayload = check getJsonContentFromFile("constraints_with_subscription"); - check validateErrorMessage(wsClient1, expectedMsgPayload, "1"); - check validateErrorMessage(wsClient2, expectedMsgPayload, "2"); -} diff --git a/ballerina-tests/tests/44_server_caches.bal b/ballerina-tests/tests/44_server_caches.bal deleted file mode 100644 index 95745a237..000000000 --- a/ballerina-tests/tests/44_server_caches.bal +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/test; -import ballerina/lang.runtime; - -@test:Config { - groups: ["server_cache"], - dataProvider: dataProviderServerCache -} -isolated function testServerSideCache(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9091/server_cache"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0.. { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache", ["server_cache_1", "server_cache_2", "server_cache_3"], (), ["A", "B", "A"]], - "2": ["server_cache_eviction", ["server_cache_2", "server_cache_4"], (), ["B", "A"]], - "3": ["server_cache_with_records", ["server_cache_with_rec_1", "server_cache_with_rec_2", "server_cache_with_rec_1"], (), ["A", "B", "A"]], - "4": ["server_cache_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_1"], (), ["A", "B", "A"]], - "5": ["server_cache_eviction_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_3"], (), ["A", "B", "A"]], - "6": ["server_cache_with_arrays", ["server_cache_with_arrays_1", "server_cache_with_arrays_2", "server_cache_with_arrays_3"], (), ["A", "B", "A"]], - "7": ["server_cache_eviction_with_arrays", ["server_cache_with_arrays_1", "server_cache_with_arrays_2", "server_cache_with_arrays_4"], (), ["A", "B", "A"]], - "8": ["server_cache_with_union", ["server_cache_with_union_1", "server_cache_with_union_2", "server_cache_with_union_1"], (), ["A", "B", "A"]], - "9": ["server_cache_eviction_with_union", ["server_cache_with_union_1", "server_cache_with_union_3", "server_cache_with_union_4"], (), ["A", "B", "A"]], - "10": ["server_cache_with_errors", ["server_cache_with_errors_1", "server_cache_with_errors_2"], (), ["A", "B"]], - "11": ["server_cache_with_nullable_inputs", ["server_cache_with_nullable_inputs_1", "server_cache_with_nullable_inputs_2", "server_cache_with_nullable_inputs_1"], (), ["A", "B", "A"]], - "12": ["server_cache_eviction_with_nullable_inputs", ["server_cache_eviction_with_nullable_inputs_1", "server_cache_eviction_with_nullable_inputs_2", "server_cache_eviction_with_nullable_inputs_3"], (), ["A", "B", "A"]], - "13": ["server_cache_with_list_inputs", ["server_cache_eviction_with_list_inputs_1", "server_cache_eviction_with_list_inputs_2", "server_cache_eviction_with_list_inputs_1"], {"names": ["Enemy3"]}, ["A", "B", "A"]], - "14": ["server_cache_eviction_with_list_inputs", ["server_cache_eviction_with_list_inputs_1", "server_cache_eviction_with_list_inputs_2", "server_cache_eviction_with_list_inputs_3"], {"names": ["Enemy3"]}, ["A", "B", "A"]], - "15": ["server_cache_with_null_values", ["server_cache_with_null_values_1", "server_cache_with_null_values_2", "server_cache_with_null_values_3"], (), ["A", "B", "A"]], - "16": ["server_cache_with_input_object", ["server_cache_with_input_object_1", "server_cache_with_input_object_2", "server_cache_with_input_object_3"], (), ["A", "B", "A"]] - }; - return dataSet; -} - -@test:Config { - groups: ["server_cache", "data_loader"], - dataProvider: dataProviderServerCacheWithDataloader -} -isolated function testServerSideCacheWithDataLoader(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9090/caching_with_dataloader"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0..< resourceFileNames.length() { - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationNames[i]); - json expectedPayload = check getJsonContentFromFile(resourceFileNames[i]); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - } - resetDispatchCounters(); -} - -function dataProviderServerCacheWithDataloader() returns map<[string, string[], json, string[]]> { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache_with_dataloader", ["server_cache_with_dataloader_1", "server_cache_with_dataloader_2", "server_cache_with_dataloader_1"], (), ["A", "B", "A"]], - "2": ["server_cache_eviction_with_dataloader", ["server_cache_with_dataloader_1", "server_cache_with_dataloader_2", "server_cache_with_dataloader_3"], (), ["A", "B", "A"]] - }; - return dataSet; -} - -@test:Config { - groups: ["server_cache", "data_loader"], - dataProvider: dataProviderServerCacheWithDataloaderInOperationalLevel -} -isolated function testServerSideCacheWithDataLoaderInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9090/caching_with_dataloader_operational"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0..< resourceFileNames.length() { - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationNames[i]); - json expectedPayload = check getJsonContentFromFile(resourceFileNames[i]); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - } - resetDispatchCounters(); -} - -function dataProviderServerCacheWithDataloaderInOperationalLevel() returns map<[string, string[], json, string[]]> { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache_with_dataloader_operational", ["server_cache_with_dataloader_3", "server_cache_with_dataloader_5", "server_cache_with_dataloader_3"], (), ["A", "B", "A"]], - "2": ["server_cache_eviction_with_dataloader_operational", ["server_cache_with_dataloader_3", "server_cache_with_dataloader_5", "server_cache_with_dataloader_4"], (), ["A", "B", "A"]] - }; - return dataSet; -} - -@test:Config { - groups: ["server_cache"], - dataProvider: dataProviderServerCacheOperationalLevel -} -isolated function testServerSideCacheInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9091/server_cache_operations"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0.. { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache", ["server_cache_1", "server_cache_2", "server_cache_1"], (), ["A", "B", "A"]], - "2": ["server_cache_eviction", ["server_cache_2", "server_cache_4"], (), ["B", "A"]], - "3": ["server_cache_with_records_operations", ["server_cache_with_rec_1", "server_cache_with_rec_3", "server_cache_with_rec_1"], (), ["A", "B", "A"]], - "4": ["server_cache_with_records_eviction", ["server_cache_with_rec_1", "server_cache_with_rec_5", "server_cache_with_rec_4"], (), ["A", "B", "A"]], - "5": ["server_cache_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_1"], (), ["A", "B", "A"]], - "6": ["server_cache_eviction_with_service_obj", ["server_cache_with_svc_obj_1", "server_cache_with_svc_obj_2", "server_cache_with_svc_obj_3"], (), ["A", "B", "A"]], - "7": ["server_cache_with_arrays", ["server_cache_with_arrays_5", "server_cache_with_arrays_2", "server_cache_with_arrays_5"], (), ["A", "B", "A"]], - "8": ["server_cache_eviction_with_arrays", ["server_cache_with_arrays_7", "server_cache_with_arrays_2", "server_cache_with_arrays_6"], (), ["A", "B", "A"]], - "9": ["server_cache_with_unions_operational_level", ["server_cache_with_unions_1", "server_cache_with_unions_2", "server_cache_with_unions_1"], (), ["A", "B", "A"]], - "10": ["server_cache_with_unions_operational_level", ["server_cache_with_unions_1", "server_cache_with_unions_2", "server_cache_with_unions_3"], (), ["A", "C", "A"]], - "11": ["server_cache_eviction", ["server_cache_2", "server_cache_4", "server_cache_5", "server_cache_4"], (), ["B", "A", "C", "A"]], - "12": ["server_cache_with_inputs", ["server_cache_with_nullable_inputs_7", "server_cache_with_nullable_inputs_8"], (), ["B", "C"]], - "13": ["server_cache_with_inputs", ["server_cache_with_empty_input_1", "server_cache_with_empty_input_2"], (), ["B", "D"]], - "14": ["server_cache_with_partial_responses", ["server_cache_with_partial_reponses_1", "server_cache_with_partial_reponses_2", "server_cache_with_partial_reponses_1"], (), ["A", "B", "A"]], - "15": ["server_cache_with_partial_responses", ["server_cache_with_partial_reponses_1", "server_cache_with_partial_reponses_2", "server_cache_with_partial_reponses_3"], (), ["A", "C", "A"]], - "16": ["server_cache_with_errors_2", ["server_cache_with_errors_4", "server_cache_with_errors_5", "server_cache_with_errors_3"], (), ["A", "B", "A"]] - }; - return dataSet; -} - -@test:Config { - groups: ["server_cache", "interceptors"], - dataProvider: dataProviderServerCacheWithInterceptors -} -isolated function testServerSideCacheWithInterceptors(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9091/field_caching_with_interceptors"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0..< resourceFileNames.length() { - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationNames[i]); - json expectedPayload = check getJsonContentFromFile(resourceFileNames[i]); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - } -} - -@test:Config { - groups: ["server_cache", "data_loader"], - dataProvider: dataProviderServerCacheWithInterceptors -} -isolated function testServerSideCacheWithInterceptorInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9091/caching_with_interceptor_operations"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0..< resourceFileNames.length() { - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationNames[i]); - json expectedPayload = check getJsonContentFromFile(resourceFileNames[i]); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - } -} - -function dataProviderServerCacheWithInterceptors() returns map<[string, string[], json, string[]]> { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache_with_interceptors", ["server_cache_with_interceptors_1", "server_cache_with_interceptors_2", "server_cache_with_interceptors_1"], (), ["A", "B", "A"]], - "2": ["server_cache_eviction_with_interceptors", ["server_cache_with_interceptors_1", "server_cache_with_interceptors_2", "server_cache_with_interceptors_3"], (), ["A", "B", "A"]] - }; - return dataSet; -} - -@test:Config { - groups: ["server_cache"] -} -isolated function testServerSideCacheInOperationalLevelWithTTL() returns error? { - string url = "http://localhost:9091/server_cache_operations"; - string document = check getGraphqlDocumentFromFile("server_cache_operations_with_TTL"); - runtime:sleep(21); - - json actualPayload = check getJsonPayloadFromService(url, document, (), "A"); - json expectedPayload = check getJsonContentFromFile("server_cache_1"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - actualPayload = check getJsonPayloadFromService(url, document, (), "B"); - expectedPayload = check getJsonContentFromFile("server_cache_10"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - actualPayload = check getJsonPayloadFromService(url, document, (), "A"); - expectedPayload = check getJsonContentFromFile("server_cache_1"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - runtime:sleep(21); - - actualPayload = check getJsonPayloadFromService(url, document, (), "A"); - expectedPayload = check getJsonContentFromFile("server_cache_9"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["server_cache"] -} -isolated function testCachingRecordWithoutNonOptionalFields() returns error? { - string url = "http://localhost:9091/server_cache_records_with_non_optional"; - string document = check getGraphqlDocumentFromFile("server_cache_records_with_non_optional_fields_1"); - - json actualPayload = check getJsonPayloadFromService(url, document, (), "GetProfiles"); - json expectedPayload = check getJsonContentFromFile("server_cache_records_with_non_optional_fields_1"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - _ = check getJsonPayloadFromService(url, document, {enableEvict: false}, "RemoveProfiles"); - - actualPayload = check getJsonPayloadFromService(url, document, (), "GetProfiles"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - document = check getGraphqlDocumentFromFile("server_cache_records_with_non_optional_fields_2"); - actualPayload = check getJsonPayloadFromService(url, document, (), "GetProfiles"); - expectedPayload = check getJsonContentFromFile("server_cache_records_with_non_optional_fields_2"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - _ = check getJsonPayloadFromService(url, document, {enableEvict: true}, "RemoveProfiles"); - - actualPayload = check getJsonPayloadFromService(url, document, (), "GetProfiles"); - expectedPayload = check getJsonContentFromFile("server_cache_records_with_non_optional_fields_3"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["server_cache"] -} -isolated function testServerCacheEvictionWithTTL() returns error? { - string url = "http://localhost:9091/field_caching_with_interceptors"; - string document = check getGraphqlDocumentFromFile("server_cache_fields_with_TTL"); - - json actualPayload = check getJsonPayloadFromService(url, document, (), "A"); - json expectedPayload = check getJsonContentFromFile("server_cache_eviction_with_TTL_1"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - actualPayload = check getJsonPayloadFromService(url, document, {"name": "Potter"}, "B"); - expectedPayload = check getJsonContentFromFile("server_cache_eviction_with_TTL_2"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - actualPayload = check getJsonPayloadFromService(url, document, (), "A"); - expectedPayload = check getJsonContentFromFile("server_cache_eviction_with_TTL_1"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - - runtime:sleep(11); - - actualPayload = check getJsonPayloadFromService(url, document, (), "A"); - expectedPayload = check getJsonContentFromFile("server_cache_eviction_with_TTL_3"); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["server_cache", "records"], - dataProvider: dataProviderServerSideCacheWithDynamicResponse -} -isolated function testServerSideCacheWithDynamicResponse(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9091/dynamic_response"; - string document = check getGraphqlDocumentFromFile(documentFile); - foreach int i in 0..< resourceFileNames.length() { - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationNames[i]); - json expectedPayload = check getJsonContentFromFile(resourceFileNames[i]); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - } -} - -function dataProviderServerSideCacheWithDynamicResponse() returns map<[string, string[], json, string[]]> { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_1", "server_cache_with_dynamic_responses_2", "server_cache_with_dynamic_responses_3"], (), ["A", "B", "C"]], - "2": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_2", "server_cache_with_dynamic_responses_4", "server_cache_with_dynamic_responses_2"], (), ["B", "D", "B"]], - "3": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_3", "server_cache_with_dynamic_responses_4", "server_cache_with_dynamic_responses_3"], (), ["C", "D", "C"]], - "4": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_3", "server_cache_with_dynamic_responses_4", "server_cache_with_dynamic_responses_5"], (), ["C", "E", "C"]], - "5": ["server_cache_with_dynamic_responses", ["server_cache_with_dynamic_responses_6", "server_cache_with_dynamic_responses_7", "server_cache_with_dynamic_responses_8"], (), ["B", "F", "B"]] - }; - return dataSet; -} - -@test:Config { - groups: ["server_cache"], - dataProvider: dataProviderServerCacheWithListInput -} -isolated function testServerCacheWithListInput(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - string url = "http://localhost:9091/cache_with_list_input"; - string document = check getGraphqlDocumentFromFile("server_cache_with_list_input"); - - foreach int i in 0..< resourceFileNames.length() { - json actualPayload = check getJsonPayloadFromService(url, document, variables, operationNames[i]); - json expectedPayload = check getJsonContentFromFile(resourceFileNames[i]); - assertJsonValuesWithOrder(actualPayload, expectedPayload); - } -} - -function dataProviderServerCacheWithListInput() returns map<[string, string[], json, string[]]> { - map<[string, string[], json, string[]]> dataSet = { - "1": ["server_cache_with_list_input", ["server_cache_with_list_input_1", "server_cache_with_list_input_2", "server_cache_with_list_input_3", "server_cache_with_list_input_1"], (), ["A", "B", "G", "A"]], - "2": ["server_cache_with_list_input", ["server_cache_with_list_input_4", "server_cache_with_list_input_5", "server_cache_with_list_input_6", "server_cache_with_list_input_4"], (), ["D", "H", "E", "D"]], - "3": ["server_cache_with_list_input", ["server_cache_with_list_input_7", "server_cache_with_list_input_8", "server_cache_with_list_input_7"], (), ["F", "I", "F"]] - }; - return dataSet; -} diff --git a/ballerina-tests/tests/45_query_complexity.bal b/ballerina-tests/tests/45_query_complexity.bal deleted file mode 100644 index 82680d4e3..000000000 --- a/ballerina-tests/tests/45_query_complexity.bal +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/test; - -@test:Config { - groups: ["query_complexity"] -} -isolated function testValidComplexityQuery() returns error? { - string url = "http://localhost:9098/complexity"; - string document = check getGraphqlDocumentFromFile("valid_complexity_query"); - string resourceFileName = "valid_complexity_query"; - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["query_complexity"] -} -isolated function testInvalidComplexityQuery() returns error? { - string url = "http://localhost:9098/complexity"; - string document = check getGraphqlDocumentFromFile("invalid_complexity_query"); - string resourceFileName = "invalid_complexity_query"; - json actualPayload = check getJsonPayloadFromService(url, document); - json expectedPayload = check getJsonContentFromFile(resourceFileName); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["query_complexity"] -} -isolated function testPrimitiveTypeFieldComplexity() returns error? { - string url = "http://localhost:9098/complexity"; - string document = "{ greeting }"; - json expectedPayload = { "data": { "greeting": "Hello" } }; - json actualPayload = check getJsonPayloadFromService(url, document); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["query_complexity"] -} -isolated function testComplexityWithUnionTypes() returns error? { - string url = "http://localhost:9098/complexity"; - string document = check getGraphqlDocumentFromFile("complexity_with_union_types"); - json expectedPayload = check getJsonContentFromFile("complexity_with_union_types"); - json actualPayload = check getJsonPayloadFromService(url, document); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["query_complexity"] -} -isolated function testComplexityWithMutation() returns error? { - string url = "http://localhost:9098/complexity"; - string document = check getGraphqlDocumentFromFile("complexity_with_mutation"); - json expectedPayload = check getJsonContentFromFile("complexity_with_mutation"); - json actualPayload = check getJsonPayloadFromService(url, document); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["query_complexity", "introspection"] -} -isolated function testGraphqlPlaygroundIntrospectionQueryWithComplexityVaildation() returns error? { - string url = "http://localhost:9098/complexity"; - string document = check getGraphqlDocumentFromFile("graphql_playground_introspection_query"); - json expectedPayload = check getJsonContentFromFile("graphql_playground_introspection_query_with_complexity_validation"); - json actualPayload = check getJsonPayloadFromService(url, document); - assertJsonValuesWithOrder(actualPayload, expectedPayload); -} diff --git a/ballerina-tests/tests/README.md b/ballerina-tests/tests/README.md deleted file mode 100644 index 81a1a8e96..000000000 --- a/ballerina-tests/tests/README.md +++ /dev/null @@ -1,12 +0,0 @@ -## Writing Tests - -All the listeners are defined in the `test_listeners.bal` file. -All the services are defined in the `test_services.bal` file. -When the GraphQL document is too long, it is saved as a separate file inside the `tests/resources/documents` directory ad a `txt` file. -All the text files can be read using the `getGraphqlDocumentFromFile()` utility function. We have to pass the file name to that function. - -Similarly, when the expected JSON file is too long, they are stored as separate JSON files under the `tests/resources/expected_results.json` directory. -Those files can be read using the `getJsonContentFromFile` utility function by passing the name of the JSON file. - -The JSON files and document files are named as same as the test functions, inside which those files used. -For example, the document used in the `testSampleFunctionality` test is saved as `sample_functionality.txt` file, and the expected result is saved as `sample_functionality.json`. diff --git a/ballerina-tests/tests/resources/documents/alias.graphql b/ballerina-tests/tests/resources/documents/alias.graphql deleted file mode 100644 index ab6c7fc90..000000000 --- a/ballerina-tests/tests/resources/documents/alias.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query getPerson { - sherlock: profile { - name { - first - } - address { - city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/alias_on_error_path.graphql b/ballerina-tests/tests/resources/documents/alias_on_error_path.graphql deleted file mode 100644 index 7ce5d17eb..000000000 --- a/ballerina-tests/tests/resources/documents/alias_on_error_path.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - user: profile{ - name_fields: name{ - username: surname - } - } -} diff --git a/ballerina-tests/tests/resources/documents/alias_on_hierarchical_resources.graphql b/ballerina-tests/tests/resources/documents/alias_on_hierarchical_resources.graphql deleted file mode 100644 index 623fe47bc..000000000 --- a/ballerina-tests/tests/resources/documents/alias_on_hierarchical_resources.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query getData { - sherlock: profile { - address { - hometown: city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/alias_on_service_objects_union.graphql b/ballerina-tests/tests/resources/documents/alias_on_service_objects_union.graphql deleted file mode 100644 index b1b0416cb..000000000 --- a/ballerina-tests/tests/resources/documents/alias_on_service_objects_union.graphql +++ /dev/null @@ -1,13 +0,0 @@ -{ - jesse: profile(id: 5) { - ... on StudentService { - characterName: name - } - } - - walt: profile(id: 1000) { - ... on TeacherService { - ssn: id - } - } -} diff --git a/ballerina-tests/tests/resources/documents/alias_with_invalid_field_name.graphql b/ballerina-tests/tests/resources/documents/alias_with_invalid_field_name.graphql deleted file mode 100644 index 47ce4c2cc..000000000 --- a/ballerina-tests/tests/resources/documents/alias_with_invalid_field_name.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query getPerson { - sherlock: profile(id: 0) { - name: firstName - address { - city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/arrays_with_errors_in_record_field.graphql b/ballerina-tests/tests/resources/documents/arrays_with_errors_in_record_field.graphql deleted file mode 100644 index 5128968ae..000000000 --- a/ballerina-tests/tests/resources/documents/arrays_with_errors_in_record_field.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query { - project { - name - tasks { - subTasks - } - } -} diff --git a/ballerina-tests/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql b/ballerina-tests/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql deleted file mode 100644 index c58675063..000000000 --- a/ballerina-tests/tests/resources/documents/attach_service_with_mutation_to_http2_based_listener.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation { - setName(name: "Heisenberg") { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql b/ballerina-tests/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql deleted file mode 100644 index edef9a275..000000000 --- a/ballerina-tests/tests/resources/documents/attach_service_with_query_to_http1_based_listener.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - person { - age - } -} diff --git a/ballerina-tests/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql b/ballerina-tests/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql deleted file mode 100644 index edef9a275..000000000 --- a/ballerina-tests/tests/resources/documents/attach_service_with_query_to_http2_based_listener.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - person { - age - } -} diff --git a/ballerina-tests/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql b/ballerina-tests/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql deleted file mode 100644 index c58675063..000000000 --- a/ballerina-tests/tests/resources/documents/attch_service_with_mutation_to_http1_based_listener.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation { - setName(name: "Heisenberg") { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/ballerina_record_as_graphql_object.graphql b/ballerina-tests/tests/resources/documents/ballerina_record_as_graphql_object.graphql deleted file mode 100644 index f0e4bba06..000000000 --- a/ballerina-tests/tests/resources/documents/ballerina_record_as_graphql_object.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query getPerson { - detective { - name, - address { - street - } - } -} diff --git a/ballerina-tests/tests/resources/documents/block_strings.graphql b/ballerina-tests/tests/resources/documents/block_strings.graphql deleted file mode 100644 index 6c3641ac8..000000000 --- a/ballerina-tests/tests/resources/documents/block_strings.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - sendEmail(message: """ - Hello, - World!, - - Yours, - GraphQL - """) -} diff --git a/ballerina-tests/tests/resources/documents/block_strings_with_double_quotes.graphql b/ballerina-tests/tests/resources/documents/block_strings_with_double_quotes.graphql deleted file mode 100644 index e72903db3..000000000 --- a/ballerina-tests/tests/resources/documents/block_strings_with_double_quotes.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - sendEmail(message: """ - Hello, - ""World""!, - - Yours, - GraphQL""") -} diff --git a/ballerina-tests/tests/resources/documents/coerce_int_input_to_float.graphql b/ballerina-tests/tests/resources/documents/coerce_int_input_to_float.graphql deleted file mode 100644 index 36c7ace5e..000000000 --- a/ballerina-tests/tests/resources/documents/coerce_int_input_to_float.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - weightInPounds(weightInKg: 1) -} diff --git a/ballerina-tests/tests/resources/documents/coerce_int_to_decimal.graphql b/ballerina-tests/tests/resources/documents/coerce_int_to_decimal.graphql deleted file mode 100644 index 145b150da..000000000 --- a/ballerina-tests/tests/resources/documents/coerce_int_to_decimal.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - convertDecimalToFloat(value: 1) -} diff --git a/ballerina-tests/tests/resources/documents/complex_introspection_query.graphql b/ballerina-tests/tests/resources/documents/complex_introspection_query.graphql deleted file mode 100644 index 5e4e1909f..000000000 --- a/ballerina-tests/tests/resources/documents/complex_introspection_query.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - __schema { - types { - name - kind - } - } -} diff --git a/ballerina-tests/tests/resources/documents/complex_introspection_query_with_other_fields.graphql b/ballerina-tests/tests/resources/documents/complex_introspection_query_with_other_fields.graphql deleted file mode 100644 index 2f39c0770..000000000 --- a/ballerina-tests/tests/resources/documents/complex_introspection_query_with_other_fields.graphql +++ /dev/null @@ -1,11 +0,0 @@ -{ - __schema { - types { - name - kind - } - } - allVehicles { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/complex_service.graphql b/ballerina-tests/tests/resources/documents/complex_service.graphql deleted file mode 100644 index 024b6fd95..000000000 --- a/ballerina-tests/tests/resources/documents/complex_service.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - profile { - name { - first, - last - } - } -} diff --git a/ballerina-tests/tests/resources/documents/complexity_with_mutation.graphql b/ballerina-tests/tests/resources/documents/complexity_with_mutation.graphql deleted file mode 100644 index 2c5679a94..000000000 --- a/ballerina-tests/tests/resources/documents/complexity_with_mutation.graphql +++ /dev/null @@ -1,13 +0,0 @@ -mutation { - addReview(input: { - title: "Great Product", - stars: 5, - description: "I love this product", - authorId: 1 - }) { - id - author { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/complexity_with_union_types.graphql b/ballerina-tests/tests/resources/documents/complexity_with_union_types.graphql deleted file mode 100644 index 6f04cc3e3..000000000 --- a/ballerina-tests/tests/resources/documents/complexity_with_union_types.graphql +++ /dev/null @@ -1,24 +0,0 @@ -{ - m1: mobile(id: 3) { - ... on Phone { - brand - os - } - } - - m2: mobile(id: 15) { - ... on Tablet { - brand - hasCellular - } - } - - m3: mobile(id: 15) { - ... on Phone { - brand - os - price - } - } -} - diff --git a/ballerina-tests/tests/resources/documents/constraints.graphql b/ballerina-tests/tests/resources/documents/constraints.graphql deleted file mode 100644 index 3fd20af2d..000000000 --- a/ballerina-tests/tests/resources/documents/constraints.graphql +++ /dev/null @@ -1,47 +0,0 @@ -query A { - movie( - movie: {name: "Interstellar", downloads: 12, imdb: 1.0, reviews:[]} - ) -} - -mutation B { - addMovie( - movie: {name: "Spider-Man: Into the Spider-Verse", downloads: 12, imdb: 1.0, reviews:[]} - ) -} - -query C { - movies( - movies: [ - {name: "", downloads: 1, imdb: 0.5, reviews:[]}, - {name: "Avengers: Endgame", downloads: 22, imdb: 0.6, reviews:[null]}, - {name: "The Lord of the Rings: The Return of the King", downloads: 3, imdb: 4.0, reviews:[]} - ] - ) -} - -subscription Sub { - movie(movie: { - name: "Saving Private Ryan", - downloads: 12, - imdb: 1.0, - reviews: [] - }) -} - -query D { - reviewStars( - reviews: [ - {comments: ["Good", "Nice"], stars: 7}, - {comments: ["Good", "Nice", "Bad"], stars: 7} - ] - ) -} - -query E($movie: MovieDetails!) { - movie(movie: $movie) -} - -query F($movies: [MovieDetails!]!) { - movies(movies: $movies) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_default_value.graphql b/ballerina-tests/tests/resources/documents/decimal_type_default_value.graphql deleted file mode 100644 index 9581ce14b..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_default_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -($val:Decimal! = 2.3332414141451451411231341451) { - convertDecimalToFloat(value:$val) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_input.graphql b/ballerina-tests/tests/resources/documents/decimal_type_input.graphql deleted file mode 100644 index 1c8b975f0..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - convertDecimalToFloat(value: 1.33) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_list_input.graphql b/ballerina-tests/tests/resources/documents/decimal_type_list_input.graphql deleted file mode 100644 index 3ca3f4aa6..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_list_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - getTotalInDecimal(prices: [[1.33, 4.8], [5.6, 6], [5, 7, 8]]) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_list_with_default_input.graphql b/ballerina-tests/tests/resources/documents/decimal_type_list_with_default_input.graphql deleted file mode 100644 index e020eeb80..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_list_with_default_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query getTotalInDecimal($prices:[[Decimal!]!]! = [[1.3323232, 4.856343], [5.63535, 6], [5, 7, 8]]){ - getTotalInDecimal(prices:$prices) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_variable_input.graphql b/ballerina-tests/tests/resources/documents/decimal_type_variable_input.graphql deleted file mode 100644 index 1d30262db..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_variable_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -($val:Decimal!) { - convertDecimalToFloat(value:$val) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_with_input_object.graphql b/ballerina-tests/tests/resources/documents/decimal_type_with_input_object.graphql deleted file mode 100644 index fa9816420..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_with_input_object.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query getSubTotal{ - getSubTotal(items: [{ name: "soap", price: 64.5555332 }, { name: "sugar", price: 154 }]) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_type_with_input_object_default_value.graphql b/ballerina-tests/tests/resources/documents/decimal_type_with_input_object_default_value.graphql deleted file mode 100644 index d0692f757..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_type_with_input_object_default_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query getSubTotalWithDefaultValue($items: [Item!] = [{ name: "soap", price: 64.5555332 }, { name: "sugar", price: 154 }]){ - getSubTotal(items: $items) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_types.graphql b/ballerina-tests/tests/resources/documents/decimal_types.graphql deleted file mode 100644 index 2edb5ff6a..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_types.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query getTotalInDecimal($prices:[[Decimal!]!]! = [[1.3323232, 4.856343], [5.63535, 6], [5, 7, 8]]){ - getTotalInDecimal(prices:$prices) -} - -query getSubTotal{ - getSubTotal(items: [{ name: "soap", price: 64.5555332 }, { name: "sugar", price: 154 }]) -} - -query getSubTotalWithDefaultValue($items: [Item!] = [{ name: "soap", price: 64.5555332 }, { name: "sugar", price: 154 }]){ - getSubTotal(items: $items) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_with_marginal_value.graphql b/ballerina-tests/tests/resources/documents/decimal_with_marginal_value.graphql deleted file mode 100644 index 1d30262db..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_with_marginal_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -($val:Decimal!) { - convertDecimalToFloat(value:$val) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_with_negative_infinity.graphql b/ballerina-tests/tests/resources/documents/decimal_with_negative_infinity.graphql deleted file mode 100644 index e715da1f8..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_with_negative_infinity.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - convertDecimalToFloat(value: -1.7E309) -} diff --git a/ballerina-tests/tests/resources/documents/decimal_with_positive_infinity.graphql b/ballerina-tests/tests/resources/documents/decimal_with_positive_infinity.graphql deleted file mode 100644 index aa6959f63..000000000 --- a/ballerina-tests/tests/resources/documents/decimal_with_positive_infinity.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - convertDecimalToFloat(value: 1.7E309) -} diff --git a/ballerina-tests/tests/resources/documents/default_values_in_input_object_fields.graphql b/ballerina-tests/tests/resources/documents/default_values_in_input_object_fields.graphql deleted file mode 100644 index f0c7b68ab..000000000 --- a/ballerina-tests/tests/resources/documents/default_values_in_input_object_fields.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - name(person: {}) -} diff --git a/ballerina-tests/tests/resources/documents/deprecated_fields_filtering.graphql b/ballerina-tests/tests/resources/documents/deprecated_fields_filtering.graphql deleted file mode 100644 index ceabae0d9..000000000 --- a/ballerina-tests/tests/resources/documents/deprecated_fields_filtering.graphql +++ /dev/null @@ -1,38 +0,0 @@ -{ - __schema { - queryType { - ...FieldFragment - } - mutationType { - ...FieldFragment - } - subscriptionType { - ...FieldFragment - } - } - __type(name: "InstrumentType") { - enumValues(includeDeprecated: false) { - name - isDeprecated - deprecationReason - } - } -} - -fragment FieldFragment on __Type { - fields(includeDeprecated: false) { - name - isDeprecated - deprecationReason - type { - ofType { - name - fields(includeDeprecated: false) { - name - isDeprecated - deprecationReason - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql b/ballerina-tests/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql deleted file mode 100644 index 012c5e8af..000000000 --- a/ballerina-tests/tests/resources/documents/deprecated_fields_filtering_with_variables.graphql +++ /dev/null @@ -1,38 +0,0 @@ -query ($includeDeprecated: Boolean!) { - __schema { - queryType { - ...FieldFragment - } - mutationType { - ...FieldFragment - } - subscriptionType { - ...FieldFragment - } - } - __type(name: "InstrumentType") { - enumValues(includeDeprecated: $includeDeprecated) { - name - isDeprecated - deprecationReason - } - } -} - -fragment FieldFragment on __Type { - fields(includeDeprecated: $includeDeprecated) { - name - isDeprecated - deprecationReason - type { - ofType { - name - fields(includeDeprecated: $includeDeprecated) { - name - isDeprecated - deprecationReason - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/deprecated_fields_introspection.graphql b/ballerina-tests/tests/resources/documents/deprecated_fields_introspection.graphql deleted file mode 100644 index 464a1ac53..000000000 --- a/ballerina-tests/tests/resources/documents/deprecated_fields_introspection.graphql +++ /dev/null @@ -1,48 +0,0 @@ -{ - __schema { - queryType { - ...TypeFragment - - } - mutationType { - ...TypeFragment - - } - subscriptionType { - ...TypeFragment - - } - } - t1: __type(name: "InstrumentType") { - enumValues(includeDeprecated: true) { - name - isDeprecated - deprecationReason - } - } - t2: __type(name: "DeprecatedAddress") { - ...TypeFragment - } -} - -fragment TypeFragment on __Type { - fields(includeDeprecated: true) { - name - isDeprecated - deprecationReason - type { - ...FieldTypeFragment - } - } -} - -fragment FieldTypeFragment on __Type { - ofType { - name - fields(includeDeprecated: true) { - name - isDeprecated - deprecationReason - } - } -} diff --git a/ballerina-tests/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql b/ballerina-tests/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql deleted file mode 100644 index 012c5e8af..000000000 --- a/ballerina-tests/tests/resources/documents/deprecated_fields_introspection_with_variables.graphql +++ /dev/null @@ -1,38 +0,0 @@ -query ($includeDeprecated: Boolean!) { - __schema { - queryType { - ...FieldFragment - } - mutationType { - ...FieldFragment - } - subscriptionType { - ...FieldFragment - } - } - __type(name: "InstrumentType") { - enumValues(includeDeprecated: $includeDeprecated) { - name - isDeprecated - deprecationReason - } - } -} - -fragment FieldFragment on __Type { - fields(includeDeprecated: $includeDeprecated) { - name - isDeprecated - deprecationReason - type { - ofType { - name - fields(includeDeprecated: $includeDeprecated) { - name - isDeprecated - deprecationReason - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/directive_locations.graphql b/ballerina-tests/tests/resources/documents/directive_locations.graphql deleted file mode 100644 index cb316b3d5..000000000 --- a/ballerina-tests/tests/resources/documents/directive_locations.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - __schema { - directives { - locations - } - } -} diff --git a/ballerina-tests/tests/resources/documents/directives.graphql b/ballerina-tests/tests/resources/documents/directives.graphql deleted file mode 100644 index a936acb5b..000000000 --- a/ballerina-tests/tests/resources/documents/directives.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query getData { - profile @skip(if: false) { - ...on Profile @include(if: true) { - name { - first @include(if: false) - ...lastName @skip(if: false) @include(if: true) - } - } - } -} - -fragment lastName on Name { - last @skip(if: false) @include(if: true) -} diff --git a/ballerina-tests/tests/resources/documents/directives_skip_all_selections.graphql b/ballerina-tests/tests/resources/documents/directives_skip_all_selections.graphql deleted file mode 100644 index 6fcc60acb..000000000 --- a/ballerina-tests/tests/resources/documents/directives_skip_all_selections.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getData { - profile(id: 1) @skip(if: true) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/directives_with_duplicate_fields.graphql b/ballerina-tests/tests/resources/documents/directives_with_duplicate_fields.graphql deleted file mode 100644 index b9c84ad15..000000000 --- a/ballerina-tests/tests/resources/documents/directives_with_duplicate_fields.graphql +++ /dev/null @@ -1,16 +0,0 @@ -query getData($optional:Boolean!, $require:Boolean = true, $profileId:Int = 1) { - ...on Query { - profile(id:$profileId) { - ...on Person @include(if: true) { - name - address @skip(if: $require){ - city - street - } - address @skip(if: $optional){ - number - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/directives_with_service_returning_objects_array.graphql b/ballerina-tests/tests/resources/documents/directives_with_service_returning_objects_array.graphql deleted file mode 100644 index b0f833dc4..000000000 --- a/ballerina-tests/tests/resources/documents/directives_with_service_returning_objects_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - searchVehicles(keyword: "vehicle") { - ...on Vehicle { - id @skip(if: true) - } - } -} diff --git a/ballerina-tests/tests/resources/documents/directives_with_variables_and_fragments.graphql b/ballerina-tests/tests/resources/documents/directives_with_variables_and_fragments.graphql deleted file mode 100644 index eb963898e..000000000 --- a/ballerina-tests/tests/resources/documents/directives_with_variables_and_fragments.graphql +++ /dev/null @@ -1,18 +0,0 @@ -query getData($optional:Boolean!, $require:Boolean = true, $profileId:Int = 1){ - ...on Query @include(if: $require) { - profile(id:$profileId) @skip(if: false) { - ...on Person { - name - ...address @include(if: $require) - } - } - } -} - -fragment address on Person { - address{ - city @include(if: $optional) - street - number @skip(if: $optional) @include(if: false) - } -} diff --git a/ballerina-tests/tests/resources/documents/documentation.graphql b/ballerina-tests/tests/resources/documents/documentation.graphql deleted file mode 100644 index e250081b2..000000000 --- a/ballerina-tests/tests/resources/documents/documentation.graphql +++ /dev/null @@ -1,48 +0,0 @@ -{ - __schema { - description - queryType { - fields { - ...FieldFragment - } - } - mutationType { - fields { - ...FieldFragment - } - } - } -} - -fragment FieldFragment on __Field { - name - description - type { - ...FieldTypeFragment - } - args { - name - description - } -} - -fragment FieldTypeFragment on __Type { - name - description - fields { - name - description - } - ofType { - ...TypeFragment - } -} - -fragment TypeFragment on __Type { - name - description - fields { - name - description - } -} diff --git a/ballerina-tests/tests/resources/documents/duplicate_fields_with_arguments.graphql b/ballerina-tests/tests/resources/documents/duplicate_fields_with_arguments.graphql deleted file mode 100644 index 858d4dee0..000000000 --- a/ballerina-tests/tests/resources/documents/duplicate_fields_with_arguments.graphql +++ /dev/null @@ -1,105 +0,0 @@ -query duplicateFieldsWithScalarArgs1 { - greet(name: "Ballerina") - greet(name: "GraphQL") - name - name(name: "GraphQL") -} - -query duplicateFieldsWithScalarArgs2($Name: String!) { - name(name: "Ballerina") - name(name: $Name) -} - -query duplicateFieldsWithScalarArgs3($Name: String! = "Ballerina") { - name(name: "Ballerina") - name(name: $Name) -} - -query duplicateFieldsWithEnumArgs1 { - isHoliday(weekday: FRIDAY) - isHoliday(weekday: SATURDAY) -} - -query duplicateFieldsWithEnumArgs2 { - isHoliday(weekday: null) - isHoliday(weekday: null) - isHoliday -} - -query duplicateFieldsWithEnumArgs3($day: Weekday!, $weekday: Weekday!) { - isHoliday(weekday: $day) - isHoliday(weekday: $weekday) -} - -query duplicateFieldsWithInputObjectArgs1 { - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur"}}) { - name - }, - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur"}}) { - name - }, - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur", age: 45}}) { - name - } -} - -query duplicateFieldsWithInputObjectArgs2($name: String! = "Arthur") { - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur"}}) { - name - }, - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur"}}) { - name - }, - book(info:{bookName: "Sherlock", edition: 4, author: {name: $name}}) { - name - } -} - -query duplicateFieldsWithInputObjectArgs3($bName:String = "Avengers", $bAuthor:ProfileDetail!) { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - name - }, - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - name - } - book(info: {bookName: "Avengers", edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - name - } -} - -query duplicateFieldsWithInputObjectArgs4 { - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur", age: 45}, movie: {movieName: "Sherlock Holmes"}}) { - name - }, - book(info:{bookName: "Sherlock", edition: 4, author: {name: "Arthur", age: 45}, movie: {movieName: "Sherlock Holmes", director: "Ritchie"}}) { - name - }, - name(person: {}), - name(person: {}), - name(person: {name: "Sam", addresses: []}) -} - -query duplicateFieldsWithListArgs1 { - concat(words: null) - concat(words: null) - concat(words: [null, "gql"]) - concat(words: [null, null]) -} - -query duplicateFieldsWithListArgs2 { - concat(words: ["Ballerina", "GraphQL"]) - concat(words: ["GraphQL", "Ballerina"]) - getTotal(prices: [[4, 5, 6, 7], [2,3,4], [3,5,6,4,2,7]]) - getTotal(prices: [[4, 5, 6, 7], [2,3,4], [3,5,6,4,7,2]]) -} - -query duplicateFieldsWithListArgs3 { - getTotal(prices: [[2,3,4], [4, 5, 6, 7], [3,5,6,4,2,7]]) - getTotal(prices: [[2,3,4], [4, 5, 6, 7], [3,5,6,4,2,7]]) - getTotal(prices: [[4, 5, 6, 7], [2,3,4], [3,5,6,4,2,7]]) - getTotal(prices: [[4, 5, 6, 7], [2,4,3], [3,5,6,4,2,7]]) - getTotal(prices: [[4, 5, 6, 7], [2,3], [3,5,6,4,2,7]]) - total:getTotal(prices: [[4, 5, 7, 8], [2,3,4], [3,5,6,4,2,7]]) - total:getTotal(prices: [[4, 5, 6, 7], [3,5,6,4,2,7]]) - total:getTotal(prices: [[4, 5, 7], [2,4,3], [3,5,6,4,2,7]]) -} diff --git a/ballerina-tests/tests/resources/documents/duplicate_fields_with_record_types.graphql b/ballerina-tests/tests/resources/documents/duplicate_fields_with_record_types.graphql deleted file mode 100644 index 3903b2cf5..000000000 --- a/ballerina-tests/tests/resources/documents/duplicate_fields_with_record_types.graphql +++ /dev/null @@ -1,22 +0,0 @@ -query getPerson { - profile { - name { - first - } - name { - first - } - name { - last - } - address { - city - } - address { - street - } - address { - city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/duplicate_inline_fragments.graphql b/ballerina-tests/tests/resources/documents/duplicate_inline_fragments.graphql deleted file mode 100644 index fbe85efa3..000000000 --- a/ballerina-tests/tests/resources/documents/duplicate_inline_fragments.graphql +++ /dev/null @@ -1,25 +0,0 @@ -query { - ...on Query { - people { - ... on Person { - address { - street - } - address { - number - street - } - address { - number - street - city - } - } - } - } - ... on Query { - students { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/duplicate_interceptors.graphql b/ballerina-tests/tests/resources/documents/duplicate_interceptors.graphql deleted file mode 100644 index cb8787eb2..000000000 --- a/ballerina-tests/tests/resources/documents/duplicate_interceptors.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - age -} diff --git a/ballerina-tests/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql b/ballerina-tests/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql deleted file mode 100644 index b611d0ec1..000000000 --- a/ballerina-tests/tests/resources/documents/duplicate_variables_with_multiple_operations.graphql +++ /dev/null @@ -1,19 +0,0 @@ -query A($profileId:Int!) { - ...data -} - -query B($profileId:Int!) { - ...data -} - -fragment data on Query { - profile(id:$profileId) { - ...people - } -} - -fragment people on Person { - address { - city - } -} diff --git a/ballerina-tests/tests/resources/documents/empty_block_string.graphql b/ballerina-tests/tests/resources/documents/empty_block_string.graphql deleted file mode 100644 index 9990cbb91..000000000 --- a/ballerina-tests/tests/resources/documents/empty_block_string.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - sendEmail(message: """""") -} diff --git a/ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects.graphql b/ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects.graphql deleted file mode 100644 index 3a43a0597..000000000 --- a/ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query { - getMovie(tvSeries: { name: "Breaking Bad", episodes: [{title:"Cancer Man", newCharacters:[]}] }) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql b/ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql deleted file mode 100644 index 70fc2aca2..000000000 --- a/ballerina-tests/tests/resources/documents/empty_list_type_within_input_objects_with_variables.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($tvSeries: TvSeries!) { - getMovie(tvSeries: $tvSeries) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/empty_string.graphql b/ballerina-tests/tests/resources/documents/empty_string.graphql deleted file mode 100644 index e5c39a730..000000000 --- a/ballerina-tests/tests/resources/documents/empty_string.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - sendEmail(message: "") -} diff --git a/ballerina-tests/tests/resources/documents/enum.graphql b/ballerina-tests/tests/resources/documents/enum.graphql deleted file mode 100644 index a345942a4..000000000 --- a/ballerina-tests/tests/resources/documents/enum.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - time { - weekday - } -} diff --git a/ballerina-tests/tests/resources/documents/enum_input_parameter.graphql b/ballerina-tests/tests/resources/documents/enum_input_parameter.graphql deleted file mode 100644 index 851b18098..000000000 --- a/ballerina-tests/tests/resources/documents/enum_input_parameter.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - isHoliday(weekday: SUNDAY) -} diff --git a/ballerina-tests/tests/resources/documents/enum_input_parameter_as_string.graphql b/ballerina-tests/tests/resources/documents/enum_input_parameter_as_string.graphql deleted file mode 100644 index 363428c49..000000000 --- a/ballerina-tests/tests/resources/documents/enum_input_parameter_as_string.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - isHoliday(weekday: "SUNDAY") -} diff --git a/ballerina-tests/tests/resources/documents/enum_inside_record.graphql b/ballerina-tests/tests/resources/documents/enum_inside_record.graphql deleted file mode 100644 index 35bd1b9b8..000000000 --- a/ballerina-tests/tests/resources/documents/enum_inside_record.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - weekday(number: 3) -} diff --git a/ballerina-tests/tests/resources/documents/enum_introspection.graphql b/ballerina-tests/tests/resources/documents/enum_introspection.graphql deleted file mode 100644 index d6ce62323..000000000 --- a/ballerina-tests/tests/resources/documents/enum_introspection.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - __schema { - types { - name - enumValues { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/enum_invalid_input_parameter.graphql b/ballerina-tests/tests/resources/documents/enum_invalid_input_parameter.graphql deleted file mode 100644 index d83d0863b..000000000 --- a/ballerina-tests/tests/resources/documents/enum_invalid_input_parameter.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - isHoliday(weekday: FUNDAY) -} diff --git a/ballerina-tests/tests/resources/documents/enum_value_introspection.graphql b/ballerina-tests/tests/resources/documents/enum_value_introspection.graphql deleted file mode 100644 index ff99716ad..000000000 --- a/ballerina-tests/tests/resources/documents/enum_value_introspection.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - __schema { - types { - enumValues - } - } -} diff --git a/ballerina-tests/tests/resources/documents/enum_with_union.graphql b/ballerina-tests/tests/resources/documents/enum_with_union.graphql deleted file mode 100644 index b400e13db..000000000 --- a/ballerina-tests/tests/resources/documents/enum_with_union.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - day(number: 10) -} diff --git a/ballerina-tests/tests/resources/documents/enum_with_values_assigned.graphql b/ballerina-tests/tests/resources/documents/enum_with_values_assigned.graphql deleted file mode 100644 index 98e1fb7eb..000000000 --- a/ballerina-tests/tests/resources/documents/enum_with_values_assigned.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - month(month: JANUARY) -} diff --git a/ballerina-tests/tests/resources/documents/execute_same_interceptor_multiple_times.graphql b/ballerina-tests/tests/resources/documents/execute_same_interceptor_multiple_times.graphql deleted file mode 100644 index cb8787eb2..000000000 --- a/ballerina-tests/tests/resources/documents/execute_same_interceptor_multiple_times.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - age -} diff --git a/ballerina-tests/tests/resources/documents/field_object_parameter_order.graphql b/ballerina-tests/tests/resources/documents/field_object_parameter_order.graphql deleted file mode 100644 index 691af2283..000000000 --- a/ballerina-tests/tests/resources/documents/field_object_parameter_order.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query FieldObjectParameterOrder1 { - student(name: "Skinny Pete", id: 100) { - name - } -} - -query FieldObjectParameterOrder2 { - student(name: "Skinny Pete", id: 100) { - name - id - } -} diff --git a/ballerina-tests/tests/resources/documents/float_as_input.graphql b/ballerina-tests/tests/resources/documents/float_as_input.graphql deleted file mode 100644 index f498b9db0..000000000 --- a/ballerina-tests/tests/resources/documents/float_as_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - weightInPounds(weightInKg: 1.3) -} diff --git a/ballerina-tests/tests/resources/documents/float_with_negative_infinity.graphql b/ballerina-tests/tests/resources/documents/float_with_negative_infinity.graphql deleted file mode 100644 index 1714d2d27..000000000 --- a/ballerina-tests/tests/resources/documents/float_with_negative_infinity.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - weightInPounds(weightInKg: -1.7E309) -} diff --git a/ballerina-tests/tests/resources/documents/float_with_positive_infinity.graphql b/ballerina-tests/tests/resources/documents/float_with_positive_infinity.graphql deleted file mode 100644 index 8920c1791..000000000 --- a/ballerina-tests/tests/resources/documents/float_with_positive_infinity.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - weightInPounds(weightInKg: 1.7E309) -} diff --git a/ballerina-tests/tests/resources/documents/fragment_with_invalid_field.graphql b/ballerina-tests/tests/resources/documents/fragment_with_invalid_field.graphql deleted file mode 100644 index 8f0adaeab..000000000 --- a/ballerina-tests/tests/resources/documents/fragment_with_invalid_field.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query { - ...data -} - -fragment data on Query { - people { - invalid - } -} diff --git a/ballerina-tests/tests/resources/documents/fragments_on_record_objects.graphql b/ballerina-tests/tests/resources/documents/fragments_on_record_objects.graphql deleted file mode 100644 index c9df2504b..000000000 --- a/ballerina-tests/tests/resources/documents/fragments_on_record_objects.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query { - ...data -} - -fragment data on Query { - people { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/fragments_with_input_variables.graphql b/ballerina-tests/tests/resources/documents/fragments_with_input_variables.graphql deleted file mode 100644 index 7460269cf..000000000 --- a/ballerina-tests/tests/resources/documents/fragments_with_input_variables.graphql +++ /dev/null @@ -1,15 +0,0 @@ -query ($profileId:Int!){ - ...data -} - -fragment data on Query { - profile(id:$profileId) { - ...people - } -} - -fragment people on Person { - address { - city - } -} diff --git a/ballerina-tests/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql b/ballerina-tests/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql deleted file mode 100644 index 631c5c18b..000000000 --- a/ballerina-tests/tests/resources/documents/fragments_with_multiple_resource_invocation.graphql +++ /dev/null @@ -1,23 +0,0 @@ -query { - ...data -} - -fragment data on Query { - people { - ...people - } - - students { - ...student - } -} - -fragment people on Person { - address { - city - } -} - -fragment student on Student { - name -} diff --git a/ballerina-tests/tests/resources/documents/functions_with_input_parameter.graphql b/ballerina-tests/tests/resources/documents/functions_with_input_parameter.graphql deleted file mode 100644 index 030c3a6e9..000000000 --- a/ballerina-tests/tests/resources/documents/functions_with_input_parameter.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - greet(name: "Thisaru") -} diff --git a/ballerina-tests/tests/resources/documents/graphql_playground_introspection_query.graphql b/ballerina-tests/tests/resources/documents/graphql_playground_introspection_query.graphql deleted file mode 100644 index 919cd18e5..000000000 --- a/ballerina-tests/tests/resources/documents/graphql_playground_introspection_query.graphql +++ /dev/null @@ -1,99 +0,0 @@ -query IntrospectionQuery { - __schema { - queryType { - name - } - mutationType { - name - } - subscriptionType { - name - } - types { - ...FullType - } - directives { - name - description - locations - args { - ...InputValue - } - } - } -} - -fragment FullType on __Type { - kind - name - description - fields(includeDeprecated: true) { - name - description - args { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - description - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } -} - -fragment InputValue on __InputValue { - name - description - type { - ...TypeRef - } - defaultValue -} - -fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql b/ballerina-tests/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql deleted file mode 100644 index 4c8da8155..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_paths_same_type_in_multiple_paths.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - profile { - name { - address { - street - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths.graphql deleted file mode 100644 index 84a44416a..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - profile { - name { - first - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_complete.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_complete.graphql deleted file mode 100644 index 55b94ac8d..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_complete.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - profile { - name { - first - last - } - age - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_introspection.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_introspection.graphql deleted file mode 100644 index 140798ad9..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_introspection.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - __schema { - types { - name - fields { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql deleted file mode 100644 index d1ec8ed83..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - profile { - personal { - name { - first - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql deleted file mode 100644 index 0aa6f557f..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_fragments.graphql +++ /dev/null @@ -1,16 +0,0 @@ -{ - profile { - ...ProfileFragment - } -} - -fragment ProfileFragment on profile { - name { - ...NameFragment - } -} - -fragment NameFragment on name { - first - last -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql deleted file mode 100644 index 920888d51..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_multiple_fields.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - profile { - name { - first - last - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql deleted file mode 100644 index 8ea26a209..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_1.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - mountain { - trail { - getLift { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql b/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql deleted file mode 100644 index b3da1209d..000000000 --- a/ballerina-tests/tests/resources/documents/hierarchical_resource_paths_with_same_field_repeating_2.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - lift { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal.graphql deleted file mode 100644 index 879d7a570..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - decimalId(decimalId: "45.0") -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_array.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_array.graphql deleted file mode 100644 index 22c48685c..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - decimalArrayReturnRecord(decimalId: ["0.8", "5.0", "6.9"]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql deleted file mode 100644 index baa0e7bca..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_decimal_or_nil.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - decimalId1(decimalId: "45.0") -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_float.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_float.graphql deleted file mode 100644 index 88f30e70c..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_float.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - floatId(floatId: "6.0") -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_float_array.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_float_array.graphql deleted file mode 100644 index a1d740d6e..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_float_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - floatArrayReturnRecord(floatId: ["0.8", "5.0", "6.9"]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_float_array1.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_float_array1.graphql deleted file mode 100644 index 47a2b4dfe..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_float_array1.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query($ids: [ID!]!) { - floatArrayReturnRecordArray(floatIds: $ids) { - name - id - age - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_float_or_nil.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_float_or_nil.graphql deleted file mode 100644 index d7ef36f48..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_float_or_nil.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - floatId1(floatId: "6.0") -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_int.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_int.graphql deleted file mode 100644 index 794a0d96f..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_int.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - intId(intId: 56) -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_int1.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_int1.graphql deleted file mode 100644 index eb880e66b..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_int1.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - intIdReturnRecord(intId: 67) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_int_array.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_int_array.graphql deleted file mode 100644 index ea367ceab..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_int_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - intArrayReturnRecord(intId: [2, 3]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_int_or_nil.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_int_or_nil.graphql deleted file mode 100644 index d94ff7ecb..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_int_or_nil.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - intId1(intId: 56) -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_return_record.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_return_record.graphql deleted file mode 100644 index 1412aa5ea..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_return_record.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - stringIdReturnRecord(stringId: "String ID") { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_return_record_array.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_return_record_array.graphql deleted file mode 100644 index eec486a98..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_return_record_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - stringArrayReturnRecordArray(stringIds: ["One", "Two", "Three"]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_string.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_string.graphql deleted file mode 100644 index fe58818d0..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_string.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - stringId(stringId: "hello") -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_string_array.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_string_array.graphql deleted file mode 100644 index 18d38bb84..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_string_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - stringArrayReturnRecord(stringId: ["Hello", "World"]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_string_or_nil.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_string_or_nil.graphql deleted file mode 100644 index 5ccae27c4..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_string_or_nil.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - stringId1(stringId: "hello") -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid.graphql deleted file mode 100644 index 9fcbafd48..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - uuidReturnRecord(uuidId: "{\"timeLow\":32377426,\"timeMid\":55867,\"timeHiAndVersion\":6608,\"clockSeqHiAndReserved\":131,\"clockSeqLo\":89,\"node\":143363128380312}") { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array.graphql deleted file mode 100644 index 1bf441321..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - uuidArrayReturnRecord(uuidId: ["{\"timeLow\":32377426,\"timeMid\":55867,\"timeHiAndVersion\":6608,\"clockSeqHiAndReserved\":131,\"clockSeqLo\":89,\"node\":143363128380312}"]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql b/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql deleted file mode 100644 index 7c0abdc83..000000000 --- a/ballerina-tests/tests/resources/documents/id_input_type_validation_uuid_array_or_nil.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - uuidArrayReturnRecord1(uuidId: ["{\"timeLow\":32377426,\"timeMid\":55867,\"timeHiAndVersion\":6608,\"clockSeqHiAndReserved\":131,\"clockSeqLo\":89,\"node\":143363128380312}"]) { - __typename - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/id_introspection_query.graphql b/ballerina-tests/tests/resources/documents/id_introspection_query.graphql deleted file mode 100644 index b0d03f2b0..000000000 --- a/ballerina-tests/tests/resources/documents/id_introspection_query.graphql +++ /dev/null @@ -1,41 +0,0 @@ -query IntrospectionQuery { - __schema { - types { - ...FullType - } - } -} - -fragment FullType on __Type { - kind - name - fields(includeDeprecated: true) { - name - args { - ...InputValue - } - type { - ...TypeRef - } - } - inputFields { - ...InputValue - } -} - -fragment InputValue on __InputValue { - name - type { - ...TypeRef - } - defaultValue -} - -fragment TypeRef on __Type { - kind - name - ofType { - kind - name - } -} diff --git a/ballerina-tests/tests/resources/documents/inline_fragment.graphql b/ballerina-tests/tests/resources/documents/inline_fragment.graphql deleted file mode 100644 index 432d544e1..000000000 --- a/ballerina-tests/tests/resources/documents/inline_fragment.graphql +++ /dev/null @@ -1,17 +0,0 @@ -query { - ...on Query { - people { - ... on Person { - address { - city - } - } - } - } - - ... on Query { - students { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/inline_fragments_on_record_objects.graphql b/ballerina-tests/tests/resources/documents/inline_fragments_on_record_objects.graphql deleted file mode 100644 index cd4a11b2f..000000000 --- a/ballerina-tests/tests/resources/documents/inline_fragments_on_record_objects.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query { - teacher { - ... on Person { - name - } - } - student { - ... on Person { - age - } - } -} diff --git a/ballerina-tests/tests/resources/documents/inline_fragments_with_variables.graphql b/ballerina-tests/tests/resources/documents/inline_fragments_with_variables.graphql deleted file mode 100644 index 99da041d7..000000000 --- a/ballerina-tests/tests/resources/documents/inline_fragments_with_variables.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query getData($profileId:Int!){ - ...on Query { - profile(id:$profileId) { - ...on Person { - name - address { - ... on Address { - city - } - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql b/ballerina-tests/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql deleted file mode 100644 index 435462853..000000000 --- a/ballerina-tests/tests/resources/documents/inline_nested_fragments_on_record_objects.graphql +++ /dev/null @@ -1,22 +0,0 @@ -query { - teacher { - ... on Person { - name - address { - ... on Address { - city - } - } - } - } - student { - ... on Person { - age - address { - ... on Address { - city - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object.graphql b/ballerina-tests/tests/resources/documents/input_object.graphql deleted file mode 100644 index 6b825c95c..000000000 --- a/ballerina-tests/tests/resources/documents/input_object.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - searchProfile(profileDetail:{name:"Jessie", age:28}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql b/ballerina-tests/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql deleted file mode 100644 index 21cc9421b..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_include_fields_with_complex_variables.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName:String!, $bAuthor:ProfileDetail!) { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql b/ballerina-tests/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql deleted file mode 100644 index dc5691a0c..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_include_fields_with_undefined_variables.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($authorAge:Int) { - book(info: {bookName: $bName, edition: 6, author: {name: "Arthur Conan Doyle", age: $authorAge}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_include_fields_with_variables.graphql b/ballerina-tests/tests/resources/documents/input_object_include_fields_with_variables.graphql deleted file mode 100644 index 04860cf3c..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_include_fields_with_variables.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName: String!, $authorAge:Int) { - book(info: {bookName: $bName, edition: 6, author: {name: "Arthur Conan Doyle", age: $authorAge}, movie:{movieName: "Sherlock"}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_type_variables_inside_list_value.graphql b/ballerina-tests/tests/resources/documents/input_object_type_variables_inside_list_value.graphql deleted file mode 100644 index f3709bfbd..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_type_variables_inside_list_value.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query ($series1: TvSeries!){ - getSuggestions(tvSeries: [$series1]) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_default_value.graphql b/ballerina-tests/tests/resources/documents/input_object_with_default_value.graphql deleted file mode 100644 index d723cd80c..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_default_value.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName:String = "Harry", $bAuthor:ProfileDetail = { name: "J.K Rowling"}) { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_duplicate_fields.graphql b/ballerina-tests/tests/resources/documents/input_object_with_duplicate_fields.graphql deleted file mode 100644 index 9c2aa5886..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_duplicate_fields.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName:String, $bAuthor:ProfileDetail) { - book(info: {bookName: $bName, bookName: "Sherlock Return", edition: 6, author: $bAuthor, movie:{movieName: "End Game", movieName:"Venom"}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_fragment_and_variables.graphql b/ballerina-tests/tests/resources/documents/input_object_with_fragment_and_variables.graphql deleted file mode 100644 index 2f4909452..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_fragment_and_variables.graphql +++ /dev/null @@ -1,15 +0,0 @@ -query getBook($bName:String!, $bAuthor:ProfileDetail!) { - ...data - -} - -fragment data on Query { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - ...bookDetails - } -} - -fragment bookDetails on Book { - name - author -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql b/ballerina-tests/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql deleted file mode 100644 index bd7306517..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_inline_fragment_with_variables.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query getBook($bName:String!, $bAuthor:ProfileDetail!, $dir:String) { - ...on Query { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game", director: $dir}}) { - ...on Book { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments1.graphql b/ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments1.graphql deleted file mode 100644 index 86c08953c..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments1.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - searchProfile(profileDetail:{name: 5, age: "Arthur"}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments2.graphql b/ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments2.graphql deleted file mode 100644 index db34fd21d..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_invalid_arguments2.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bAuthor:ProfileDetail = { name: {}, age:{}}) { - book(info: {bookName: {name:"s"}, edition: {}, author: $bAuthor, movie:{movieName: {}}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables2.graphql b/ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables2.graphql deleted file mode 100644 index 70310d0e6..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_invalid_type_variables2.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName:String = "Harry", $bAuthor:ProfileDetail!, $dir:String) { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game", director:$dir}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_missing_arguments.graphql b/ballerina-tests/tests/resources/documents/input_object_with_missing_arguments.graphql deleted file mode 100644 index 895885d95..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_missing_arguments.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - searchProfile(profileDetail:{age: 34}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql b/ballerina-tests/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql deleted file mode 100644 index 22dd0936b..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_missing_nullable_variable_value.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName:String = "Harry", $bAuthor:ProfileDetail = { name: "J.K Rowling"}, $dir:String) { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game", director:$dir}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_missing_variables_arguments.graphql b/ballerina-tests/tests/resources/documents/input_object_with_missing_variables_arguments.graphql deleted file mode 100644 index 21cc9421b..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_missing_variables_arguments.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName:String!, $bAuthor:ProfileDetail!) { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game"}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_nested_object.graphql b/ballerina-tests/tests/resources/documents/input_object_with_nested_object.graphql deleted file mode 100644 index f555b2027..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_nested_object.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query getBook { - book(info: {bookName: "Harry", edition: 6, author: { name: "Sherlock" }, movie:{movieName: "Venom", director: "Dexter Fletcher"}}) { - name - author - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_undefined_fields.graphql b/ballerina-tests/tests/resources/documents/input_object_with_undefined_fields.graphql deleted file mode 100644 index 56bf2bdf3..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_undefined_fields.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query getBook($bName: String!) { - book(info: {bookName: $bName, edition: 6, author: {name: "Arthur Conan Doyle", address: "London"}, movie:{movieName: "Sherlock", year:2005}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_with_unexpected_variable_values.graphql b/ballerina-tests/tests/resources/documents/input_object_with_unexpected_variable_values.graphql deleted file mode 100644 index bd7306517..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_with_unexpected_variable_values.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query getBook($bName:String!, $bAuthor:ProfileDetail!, $dir:String) { - ...on Query { - book(info: {bookName: $bName, edition: 6, author: $bAuthor, movie:{movieName: "End Game", director: $dir}}) { - ...on Book { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/input_object_without_optional_fields.graphql b/ballerina-tests/tests/resources/documents/input_object_without_optional_fields.graphql deleted file mode 100644 index 6d5ac081a..000000000 --- a/ballerina-tests/tests/resources/documents/input_object_without_optional_fields.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - book(info: {bookName: "Study in Scarlet", edition: 6, author: {name: "Arthur Conan Doyle", age: 67}}) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql b/ballerina-tests/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql deleted file mode 100644 index 990858a17..000000000 --- a/ballerina-tests/tests/resources/documents/input_parameter_type_not_present_in_return_types.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - isLegal(age: 21) -} diff --git a/ballerina-tests/tests/resources/documents/input_with_escape_characters.graphql b/ballerina-tests/tests/resources/documents/input_with_escape_characters.graphql deleted file mode 100644 index ef450dbf2..000000000 --- a/ballerina-tests/tests/resources/documents/input_with_escape_characters.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - type(version: "1.0.0") -} diff --git a/ballerina-tests/tests/resources/documents/input_with_unicode_characters.graphql b/ballerina-tests/tests/resources/documents/input_with_unicode_characters.graphql deleted file mode 100644 index c0b188340..000000000 --- a/ballerina-tests/tests/resources/documents/input_with_unicode_characters.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - version(name: "SwanLake") -} diff --git a/ballerina-tests/tests/resources/documents/interceptor_execution_order.graphql b/ballerina-tests/tests/resources/documents/interceptor_execution_order.graphql deleted file mode 100644 index 853861a88..000000000 --- a/ballerina-tests/tests/resources/documents/interceptor_execution_order.graphql +++ /dev/null @@ -1,4 +0,0 @@ -{ - quote, - status -} diff --git a/ballerina-tests/tests/resources/documents/interceptors.graphql b/ballerina-tests/tests/resources/documents/interceptors.graphql deleted file mode 100644 index 2ceadad39..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - enemy -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_returning_error1.graphql b/ballerina-tests/tests/resources/documents/interceptors_returning_error1.graphql deleted file mode 100644 index e6f85724f..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_returning_error1.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - greet -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_returning_error2.graphql b/ballerina-tests/tests/resources/documents/interceptors_returning_error2.graphql deleted file mode 100644 index c7736f29f..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_returning_error2.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - friends -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_returning_error3.graphql b/ballerina-tests/tests/resources/documents/interceptors_returning_error3.graphql deleted file mode 100644 index f3dbeb7e4..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_returning_error3.graphql +++ /dev/null @@ -1,6 +0,0 @@ -{ - person { - name, - age - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql b/ballerina-tests/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql deleted file mode 100644 index ecea22151..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_returning_errors_with_hierarchical_resources.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - name, - age, - address { - city, - street, - number - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_arrays.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_arrays.graphql deleted file mode 100644 index 35be1d797..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_arrays.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - houses -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification1.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification1.graphql deleted file mode 100644 index be56eb08f..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification1.graphql +++ /dev/null @@ -1,11 +0,0 @@ -{ - students { - id, - name - }, - teachers { - id, - name, - subject - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification2.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification2.graphql deleted file mode 100644 index 82041d4bf..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_destructive_modification2.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - students { - id, - name - }, - teachers { - id, - name - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_enum.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_enum.graphql deleted file mode 100644 index 54efc0d24..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_enum.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - holidays -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_fragments.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_fragments.graphql deleted file mode 100644 index 659fd5229..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_fragments.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query { - teacher { - ...data - } -} - -fragment data on TeacherService { - id - name - subject -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql deleted file mode 100644 index 5663b11f4..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql +++ /dev/null @@ -1,29 +0,0 @@ -subscription getStudents { - ...personFieldsA -} - -subscription getNewStudents { - ...personFieldsB -} - -fragment personFieldsA on Subscription { - ...studentFieldsA -} - -fragment studentFieldsA on Subscription { - students { - id - name - } -} - -fragment personFieldsB on Subscription { - ...studentFieldsB -} - -fragment studentFieldsB on Subscription { - newStudents { - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_hierarchical_paths.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_hierarchical_paths.graphql deleted file mode 100644 index 708ad5604..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_hierarchical_paths.graphql +++ /dev/null @@ -1,6 +0,0 @@ -{ - name { - first, - last - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql deleted file mode 100644 index cb8787eb2..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification1.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - age -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql deleted file mode 100644 index c7736f29f..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification2.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - friends -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql deleted file mode 100644 index c88688ad7..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification3.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - person { - name, - address { - city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql deleted file mode 100644 index ab940161d..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_invalid_destructive_modification4.graphql +++ /dev/null @@ -1,6 +0,0 @@ -{ - student { - id, - name - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_map.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_map.graphql deleted file mode 100644 index 98aaa92cd..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_map.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query { - languages { - backend: name(key: "backend"), - name(key: "frontend"), - data: name(key: "data"), - native: name(key: "native") - }, - updatedLanguages { - backend: name(key: "backend"), - frontend: name(key: "frontend"), - data: name(key: "data"), - native: name(key: "native") - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_mutation.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_mutation.graphql deleted file mode 100644 index 18981c9e4..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_mutation.graphql +++ /dev/null @@ -1,9 +0,0 @@ -mutation { - setName(name: "Heisenberg") { - name - }, - setAge(age: 14) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_null_value2.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_null_value2.graphql deleted file mode 100644 index fa63bcd2c..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_null_value2.graphql +++ /dev/null @@ -1,4 +0,0 @@ -{ - name, - age -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_record_fields.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_record_fields.graphql deleted file mode 100644 index 06ee4807d..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_record_fields.graphql +++ /dev/null @@ -1,15 +0,0 @@ -{ - profile { - name, - age, - address { - number, - street, - city - } - } - newProfile { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_records.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_records.graphql deleted file mode 100644 index d046a3038..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_records.graphql +++ /dev/null @@ -1,13 +0,0 @@ -{ - userProfile: profile { - name, - userName: name, - homeAddress: address { - number, - streetName: street - } - }, - contactDetails:contact { - number - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_records_and_fragments.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_records_and_fragments.graphql deleted file mode 100644 index fa49a84ca..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_records_and_fragments.graphql +++ /dev/null @@ -1,18 +0,0 @@ -{ - profile { - name, - age, - ...P1 - } - newProfile { - ...P1 - } -} - -fragment P1 on Person { - address { - number, - street, - city - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_service_object.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_service_object.graphql deleted file mode 100644 index 6483c2c3f..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_service_object.graphql +++ /dev/null @@ -1,11 +0,0 @@ -{ - teacher{ - id, - name, - subject - }, - student{ - id, - name - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_records.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_records.graphql deleted file mode 100644 index a7fabb0b4..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_records.graphql +++ /dev/null @@ -1,13 +0,0 @@ -subscription A{ - books { - name - author - } -} - -subscription B{ - newBooks { - name - author - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql deleted file mode 100644 index 99e09c1db..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql +++ /dev/null @@ -1,22 +0,0 @@ -subscription unionTypes1 { - multipleValues1 { - ...StudentFragment - ...TeacherFragment - } -} - -subscription unionTypes2 { - multipleValues2 { - ...TeacherFragment - } -} - -fragment StudentFragment on StudentService { - id - name -} - -fragment TeacherFragment on TeacherService { - name - subject -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_table.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_table.graphql deleted file mode 100644 index e45a8e7f0..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_table.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - employees { - name - }, - oldEmployees { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/interceptors_with_union.graphql b/ballerina-tests/tests/resources/documents/interceptors_with_union.graphql deleted file mode 100644 index 383ff47a9..000000000 --- a/ballerina-tests/tests/resources/documents/interceptors_with_union.graphql +++ /dev/null @@ -1,15 +0,0 @@ -{ - profile1(id: 4) { - ...on StudentService { - id, - name - } - }, - profile2(id: 4) { - ...on TeacherService { - id, - name, - subject - } - } -} diff --git a/ballerina-tests/tests/resources/documents/interface_field.graphql b/ballerina-tests/tests/resources/documents/interface_field.graphql deleted file mode 100644 index 304e84c61..000000000 --- a/ballerina-tests/tests/resources/documents/interface_field.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - characters { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/interface_introspection.graphql b/ballerina-tests/tests/resources/documents/interface_introspection.graphql deleted file mode 100644 index 8e39206fd..000000000 --- a/ballerina-tests/tests/resources/documents/interface_introspection.graphql +++ /dev/null @@ -1,12 +0,0 @@ -{ - __schema { - types { - name - kind - possibleTypes { - name - kind - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/interfaces.graphql b/ballerina-tests/tests/resources/documents/interfaces.graphql deleted file mode 100644 index d577f4c04..000000000 --- a/ballerina-tests/tests/resources/documents/interfaces.graphql +++ /dev/null @@ -1,16 +0,0 @@ -{ - characters { - ...HumanFragment - ...DroidFragment - } -} - -fragment HumanFragment on Human { - name - id -} - -fragment DroidFragment on Droid { - name - year -} diff --git a/ballerina-tests/tests/resources/documents/interfaces_with_interface_type_array.graphql b/ballerina-tests/tests/resources/documents/interfaces_with_interface_type_array.graphql deleted file mode 100644 index b19003342..000000000 --- a/ballerina-tests/tests/resources/documents/interfaces_with_interface_type_array.graphql +++ /dev/null @@ -1,13 +0,0 @@ -{ - ships { - id - ...on Starship { - enemyShips { - id - ...on Starship { - driver - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/interfaces_with_invalid_field.graphql b/ballerina-tests/tests/resources/documents/interfaces_with_invalid_field.graphql deleted file mode 100644 index 2d180f267..000000000 --- a/ballerina-tests/tests/resources/documents/interfaces_with_invalid_field.graphql +++ /dev/null @@ -1,20 +0,0 @@ -{ - characters { - ...CharacterFragment - } -} - -fragment CharacterFragment on Character { - name - age - ...HumanFragment - ...DroidFragment -} - -fragment HumanFragment on Human { - id -} - -fragment DroidFragment on Droid { - year -} diff --git a/ballerina-tests/tests/resources/documents/interfaces_with_type_name_introspection.graphql b/ballerina-tests/tests/resources/documents/interfaces_with_type_name_introspection.graphql deleted file mode 100644 index 0931b3e4a..000000000 --- a/ballerina-tests/tests/resources/documents/interfaces_with_type_name_introspection.graphql +++ /dev/null @@ -1,20 +0,0 @@ -{ - characters { - ...CharacterFragment - } -} - -fragment CharacterFragment on Character { - __typename - name - ...HumanFragment - ...DroidFragment -} - -fragment HumanFragment on Human { - id -} - -fragment DroidFragment on Droid { - year -} diff --git a/ballerina-tests/tests/resources/documents/introspection_for_person_and_greet.graphql b/ballerina-tests/tests/resources/documents/introspection_for_person_and_greet.graphql deleted file mode 100644 index 919cd18e5..000000000 --- a/ballerina-tests/tests/resources/documents/introspection_for_person_and_greet.graphql +++ /dev/null @@ -1,99 +0,0 @@ -query IntrospectionQuery { - __schema { - queryType { - name - } - mutationType { - name - } - subscriptionType { - name - } - types { - ...FullType - } - directives { - name - description - locations - args { - ...InputValue - } - } - } -} - -fragment FullType on __Type { - kind - name - description - fields(includeDeprecated: true) { - name - description - args { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - description - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } -} - -fragment InputValue on __InputValue { - name - description - type { - ...TypeRef - } - defaultValue -} - -fragment TypeRef on __Type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/introspection_on_service_with_input_objects.graphql b/ballerina-tests/tests/resources/documents/introspection_on_service_with_input_objects.graphql deleted file mode 100644 index 34df3b20f..000000000 --- a/ballerina-tests/tests/resources/documents/introspection_on_service_with_input_objects.graphql +++ /dev/null @@ -1,13 +0,0 @@ -{ - __schema { - types { - name - inputFields { - name - type { - kind - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/introspection_query_with_missing_selection.graphql b/ballerina-tests/tests/resources/documents/introspection_query_with_missing_selection.graphql deleted file mode 100644 index 629934422..000000000 --- a/ballerina-tests/tests/resources/documents/introspection_query_with_missing_selection.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - __schema -} diff --git a/ballerina-tests/tests/resources/documents/invalid_complexity_query.graphql b/ballerina-tests/tests/resources/documents/invalid_complexity_query.graphql deleted file mode 100644 index ade252c88..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_complexity_query.graphql +++ /dev/null @@ -1,25 +0,0 @@ -query ComplexQuery { - d1: device(id: 2) { - ...DeviceFragment - ... on Phone { - os - } - } - d2: device(id: 12) { - ...DeviceFragment - ... on Laptop { - processor - } - } - d3: device(id: 22) { - ...DeviceFragment - ... on Tablet { - hasCellular - } - } -} - -fragment DeviceFragment on Device { - brand - model -} diff --git a/ballerina-tests/tests/resources/documents/invalid_hierarchical_resource_paths.graphql b/ballerina-tests/tests/resources/documents/invalid_hierarchical_resource_paths.graphql deleted file mode 100644 index e1fd3117b..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_hierarchical_resource_paths.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - profile { - name { - first - middle - } - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_introspection_query.graphql b/ballerina-tests/tests/resources/documents/invalid_introspection_query.graphql deleted file mode 100644 index a9e18a02f..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_introspection_query.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - __schema { - greet - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_list_type_for_input_objects.graphql b/ballerina-tests/tests/resources/documents/invalid_list_type_for_input_objects.graphql deleted file mode 100644 index 2f6e47c4f..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_list_type_for_input_objects.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query { - getMovie(tvSeries: [{ name: "Breaking Bad", episodes: [{title:"Cancer Man", newCharacters:[true, graphql]}] }]) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects.graphql b/ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects.graphql deleted file mode 100644 index 0f9009aa0..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query { - getMovie(tvSeries: { name: "Breaking Bad", episodes: [{title:"Cancer Man", newCharacters:[true, graphql]}] }) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql b/ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql deleted file mode 100644 index 70fc2aca2..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_list_type_within_input_objects_with_variables.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($tvSeries: TvSeries!) { - getMovie(tvSeries: $tvSeries) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_query_from_service_object_resource.graphql b/ballerina-tests/tests/resources/documents/invalid_query_from_service_object_resource.graphql deleted file mode 100644 index 4acb851c9..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_query_from_service_object_resource.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - profile { - name { - nonExisting - } - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql b/ballerina-tests/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql deleted file mode 100644 index ce68bef54..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_query_with_distinct_service_unions.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - profile(id: 200) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_schema_introspection_field.graphql b/ballerina-tests/tests/resources/documents/invalid_schema_introspection_field.graphql deleted file mode 100644 index 9412a3974..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_schema_introspection_field.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - profile(id: 1) { - name - __schema { - queryType { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_spread_inline_fragments.graphql b/ballerina-tests/tests/resources/documents/invalid_spread_inline_fragments.graphql deleted file mode 100644 index 929f65aac..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_spread_inline_fragments.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query { - __schema { - types { - ...on Student { - name - } - ...on Person { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql b/ballerina-tests/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql deleted file mode 100644 index 95614363b..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_value_with_nested_list_in_input_objects.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query { - getMovie(tvSeries: { name: "Breaking Bad", episodes: {title:"Cancer Man", newCharacters:["paul"]}}) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/invalid_variables_inside_list_value.graphql b/ballerina-tests/tests/resources/documents/invalid_variables_inside_list_value.graphql deleted file mode 100644 index 68d2f3eb3..000000000 --- a/ballerina-tests/tests/resources/documents/invalid_variables_inside_list_value.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ( $p1:ProfileDetail, $p2:ProfileDetail!){ - searchProfile(profileDetail:[$p1, $p2]){ - age - name - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_input.graphql b/ballerina-tests/tests/resources/documents/list_type_input.graphql deleted file mode 100644 index ea93c4eed..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - concat(words: ["Hello!", "This", "is", "Ballerina", "GraphQL"]) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_input_with_empty_value.graphql b/ballerina-tests/tests/resources/documents/list_type_input_with_empty_value.graphql deleted file mode 100644 index 02126ab28..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_input_with_empty_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - concat(words: []) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_input_with_null_value.graphql b/ballerina-tests/tests/resources/documents/list_type_input_with_null_value.graphql deleted file mode 100644 index d093d9bf2..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_input_with_null_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - concat(words: ["Hello!", "This", "is", "a", "Null", "Value", "->", null]) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_input_with_variable.graphql b/ballerina-tests/tests/resources/documents/list_type_input_with_variable.graphql deleted file mode 100644 index d3ab2bfa5..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_input_with_variable.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ($words:[String!]) { - concat(words: $words) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_inputs_with_nested_list.graphql b/ballerina-tests/tests/resources/documents/list_type_inputs_with_nested_list.graphql deleted file mode 100644 index b6e449006..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_inputs_with_nested_list.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - getTotal(prices: [[2,3,4], [4, 5, 6, 7], [3,5,6,4,2,7]]) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_variables_inside_list_value.graphql b/ballerina-tests/tests/resources/documents/list_type_variables_inside_list_value.graphql deleted file mode 100644 index 15104028d..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_variables_inside_list_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ($list1: [Float!]!) { - getTotal(prices: [[2,3,4], $list1, [3,5,6,4,2,7]]) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_variables_with_input_objects.graphql b/ballerina-tests/tests/resources/documents/list_type_variables_with_input_objects.graphql deleted file mode 100644 index 9a5563906..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_variables_with_input_objects.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query ($tvSeries: [TvSeries!]!) { - getSuggestions(tvSeries: $tvSeries) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql b/ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql deleted file mode 100644 index 9a5563906..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_input_objects.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query ($tvSeries: [TvSeries!]!) { - getSuggestions(tvSeries: $tvSeries) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql b/ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql deleted file mode 100644 index 9a5563906..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_variables_with_invalid_nested_list_in_input_object.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query ($tvSeries: [TvSeries!]!) { - getSuggestions(tvSeries: $tvSeries) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql b/ballerina-tests/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql deleted file mode 100644 index 9a5563906..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_variables_with_nested_list_in_input_object.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query ($tvSeries: [TvSeries!]!) { - getSuggestions(tvSeries: $tvSeries) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_default_value.graphql b/ballerina-tests/tests/resources/documents/list_type_with_default_value.graphql deleted file mode 100644 index 5f4384fac..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_default_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - isIncludeHoliday -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_enum_values.graphql b/ballerina-tests/tests/resources/documents/list_type_with_enum_values.graphql deleted file mode 100644 index 85ba89ae8..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_enum_values.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - isIncludeHoliday(days: [MONDAY, FRIDAY, TUESDAY, SATURDAY]) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_input_objects.graphql b/ballerina-tests/tests/resources/documents/list_type_with_input_objects.graphql deleted file mode 100644 index dc9079118..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_input_objects.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - getSuggestions(tvSeries: [{ name: "Breaking Bad", episodes: [{title:"ep1"}] }]) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_enum_values.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_enum_values.graphql deleted file mode 100644 index cb80e42f3..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_enum_values.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - isIncludeHoliday(days: [MONDAY, FRIDAY, TUESDAY, SATURDAY, WEdnesday, 4]) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql deleted file mode 100644 index 2dff2d3bb..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_input_objects_value.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - getSuggestions(tvSeries: [{ name: "Breaking Bad", episodes: [{title:"ep1"}]}, { name: "Breaking Bad", episodes:true }]) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql deleted file mode 100644 index 157a5d16e..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_nested_list_in_input_object.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - getSuggestions(tvSeries: [{ name: "GOT", episodes: [{title:"ep1", newCharacters:["Sherlock", "Jessie"]}, {title:"ep2", newCharacters:[true, 4]}]}]) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql deleted file mode 100644 index dbb9bc8f8..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_4.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ($prices: [[Float!]!] = [ 2, 3, 4, 5]) { - getTotal(prices: $prices) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql deleted file mode 100644 index 41d55a871..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_7.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($profileDetail: [ProfileDetail] = [null, [], {name: "Arthur"}]) { - searchProfile(profileDetail: $profileDetail) { - name, - age - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql deleted file mode 100644 index 688fffddc..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_8.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ($days:[Weekday] = [MONDAY, FRIDAY, TUESDAY, SATURDAY]) { - isIncludeHoliday(days: $days) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql b/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql deleted file mode 100644 index a35597f04..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_invalid_variable_default_values_9.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ($days:[Weekday!] = [MONDAY, FRIDAY, TUSDAY, SATURDAY]) { - isIncludeHoliday(days: $days) -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql b/ballerina-tests/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql deleted file mode 100644 index aba8a0337..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_nested_list_in_input_object.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - getSuggestions(tvSeries: [{ name: "GOT", episodes: [{title:"ep1", newCharacters:["Sherlock", "Jessie"]}, {title:"ep2", newCharacters:["Michael", "Jessie"]}]}]) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_5.graphql b/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_5.graphql deleted file mode 100644 index 3c8849d6d..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_5.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($profileDetail: [ProfileDetail!] = [{name: "Jessie", age: 28}, {name: "Arthur", age: 5}]){ - searchProfile(profileDetail: $profileDetail) { - name, - age - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_6.graphql b/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_6.graphql deleted file mode 100644 index 3c8849d6d..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_6.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($profileDetail: [ProfileDetail!] = [{name: "Jessie", age: 28}, {name: "Arthur", age: 5}]){ - searchProfile(profileDetail: $profileDetail) { - name, - age - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_7.graphql b/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_7.graphql deleted file mode 100644 index fc3abb587..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_7.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($tvSeries: [TvSeries!]! = [{ name: "GOT", episodes: [ {title:"ep1", newCharacters: ["Sherlock", "Jessie"]}, {title:"ep2", newCharacters: ["Michael", "Jessie"]}]} ]){ - getSuggestions(tvSeries: $tvSeries){ - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_8.graphql b/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_8.graphql deleted file mode 100644 index a48ac9fe2..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_with_variable_default_values_8.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($tvSeries: TvSeries = { name: "Breaking Bad", episodes: [{title:"Cancer Man", newCharacters: ["Sherlock"]}] }) { - getMovie(tvSeries: $tvSeries) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_within_input_objects.graphql b/ballerina-tests/tests/resources/documents/list_type_within_input_objects.graphql deleted file mode 100644 index 55aff2675..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_within_input_objects.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query { - getMovie(tvSeries: { name: "Breaking Bad", episodes: [{title:"Cancer Man"}] }) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/list_type_within_input_objects_with_variables.graphql b/ballerina-tests/tests/resources/documents/list_type_within_input_objects_with_variables.graphql deleted file mode 100644 index c32b3b16f..000000000 --- a/ballerina-tests/tests/resources/documents/list_type_within_input_objects_with_variables.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query ($tvSeries: TvSeries!) { - getMovie(tvSeries: $tvSeries ) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/map.graphql b/ballerina-tests/tests/resources/documents/map.graphql deleted file mode 100644 index 9a2ce0307..000000000 --- a/ballerina-tests/tests/resources/documents/map.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - company { - workers(key: "id1") { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/map_with_invalid_key.graphql b/ballerina-tests/tests/resources/documents/map_with_invalid_key.graphql deleted file mode 100644 index 8cd8a044e..000000000 --- a/ballerina-tests/tests/resources/documents/map_with_invalid_key.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query { - languages { - backend: name(key: "backend") - desktop: name(key: "desktop") - frontend: name(key: "frontend") - deploy: name(key: "deployment") - } -} diff --git a/ballerina-tests/tests/resources/documents/map_with_valid_key.graphql b/ballerina-tests/tests/resources/documents/map_with_valid_key.graphql deleted file mode 100644 index e5cecec4b..000000000 --- a/ballerina-tests/tests/resources/documents/map_with_valid_key.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query($purpose: String!) { - languages { - backend: name(key: $purpose) - } -} diff --git a/ballerina-tests/tests/resources/documents/map_without_key_input.graphql b/ballerina-tests/tests/resources/documents/map_without_key_input.graphql deleted file mode 100644 index 4aa555bca..000000000 --- a/ballerina-tests/tests/resources/documents/map_without_key_input.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - company { - workers { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/multiple_directive_usage_in_fields.graphql b/ballerina-tests/tests/resources/documents/multiple_directive_usage_in_fields.graphql deleted file mode 100644 index 7f0a05d9f..000000000 --- a/ballerina-tests/tests/resources/documents/multiple_directive_usage_in_fields.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query getPerson { - detective @skip(if: false) @include(if: true) { - name @skip(if: true) @include(if: true) - age @include(if:false) @skip(if: true) - address { - city @include(if: false) @skip(if:false) - street - } - } -} diff --git a/ballerina-tests/tests/resources/documents/multiple_mutations.graphql b/ballerina-tests/tests/resources/documents/multiple_mutations.graphql deleted file mode 100644 index 2e74bc2bb..000000000 --- a/ballerina-tests/tests/resources/documents/multiple_mutations.graphql +++ /dev/null @@ -1,14 +0,0 @@ -mutation { - setName(name: "Heisenberg") { - name - address { - city - } - } - setCity(city: "New Hampshire") { - name - address { - city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/multiple_mutations_on_service_objects.graphql b/ballerina-tests/tests/resources/documents/multiple_mutations_on_service_objects.graphql deleted file mode 100644 index f81dc804f..000000000 --- a/ballerina-tests/tests/resources/documents/multiple_mutations_on_service_objects.graphql +++ /dev/null @@ -1,10 +0,0 @@ -mutation { - setTeacherSubject(subject: "Chemistry") { - subject - name - } - setTeacherName(name: "Walter White") { - name - subject - } -} diff --git a/ballerina-tests/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql b/ballerina-tests/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql deleted file mode 100644 index 33bc8a2ec..000000000 --- a/ballerina-tests/tests/resources/documents/multiple_operations_without_operation_name_in_request.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query getDetective { - detective { - name - } -} - -query getAge { - teacher { - age - } -} diff --git a/ballerina-tests/tests/resources/documents/multiple_variable_types_with_single_query.graphql b/ballerina-tests/tests/resources/documents/multiple_variable_types_with_single_query.graphql deleted file mode 100644 index d50c659a4..000000000 --- a/ballerina-tests/tests/resources/documents/multiple_variable_types_with_single_query.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query ($name:String!, $age:Int!, $weight:Float!, $day:Weekday, $holiday:Boolean!) { - greet (name:$name) - isLegal (age:$age) - weightInPounds (weightInKg:$weight) - isHoliday (weekday:$day) - getDay(isHoliday:$holiday) -} diff --git a/ballerina-tests/tests/resources/documents/mutation.graphql b/ballerina-tests/tests/resources/documents/mutation.graphql deleted file mode 100644 index c58675063..000000000 --- a/ballerina-tests/tests/resources/documents/mutation.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation { - setName(name: "Heisenberg") { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql b/ballerina-tests/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql deleted file mode 100644 index c58675063..000000000 --- a/ballerina-tests/tests/resources/documents/mutation_request_on_non_mutable_schema.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation { - setName(name: "Heisenberg") { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/mutation_type_introspection.graphql b/ballerina-tests/tests/resources/documents/mutation_type_introspection.graphql deleted file mode 100644 index e9bb40cab..000000000 --- a/ballerina-tests/tests/resources/documents/mutation_type_introspection.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - __schema { - mutationType { - kind - fields { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/named_fragments_with_duplicate_fields.graphql b/ballerina-tests/tests/resources/documents/named_fragments_with_duplicate_fields.graphql deleted file mode 100644 index ad3a61d55..000000000 --- a/ballerina-tests/tests/resources/documents/named_fragments_with_duplicate_fields.graphql +++ /dev/null @@ -1,37 +0,0 @@ -query { - ...data -} - -fragment data on Query { - people { - ...p1 - ...p2 - } - - students { - ...student - } -} - -fragment p1 on Person { - address { - city - } - address { - street - city - } -} - -fragment p2 on Person { - address { - city - } - address { - number - } -} - -fragment student on Student { - name -} diff --git a/ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql b/ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql deleted file mode 100644 index df849bf98..000000000 --- a/ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_1.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - getTotal(prices: [[2, 3, d], [4, 5, 6, "is"], [3, 5, 6, 4 , true, 7]]) -} diff --git a/ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql b/ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql deleted file mode 100644 index 2ceef76b1..000000000 --- a/ballerina-tests/tests/resources/documents/nested_list_input_with_invalid_values_2.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - getTotal(prices: [ 2, 3, 4, 5, 6]) -} diff --git a/ballerina-tests/tests/resources/documents/nested_map.graphql b/ballerina-tests/tests/resources/documents/nested_map.graphql deleted file mode 100644 index ee953e4b3..000000000 --- a/ballerina-tests/tests/resources/documents/nested_map.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query { - company { - workers(key: "id3") { - contacts(key: "home") { - number - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/nested_map_without_key_input.graphql b/ballerina-tests/tests/resources/documents/nested_map_without_key_input.graphql deleted file mode 100644 index f7f1d1813..000000000 --- a/ballerina-tests/tests/resources/documents/nested_map_without_key_input.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - company { - workers(key: "w1") { - contacts - } - } -} diff --git a/ballerina-tests/tests/resources/documents/nested_records_array.graphql b/ballerina-tests/tests/resources/documents/nested_records_array.graphql deleted file mode 100644 index 629fbbd55..000000000 --- a/ballerina-tests/tests/resources/documents/nested_records_array.graphql +++ /dev/null @@ -1,11 +0,0 @@ -{ - students { - name - courses { - name - books { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_list.graphql b/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_list.graphql deleted file mode 100644 index 0344e4fb4..000000000 --- a/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_list.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - cities( - addresses: [ - { number: "308", street: "Negra Arroyo Lane", city: "Albequerque" }, - { number: "Unknown", street: "Unknown", city: "Hogwarts" } - ] - ) -} diff --git a/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record.graphql b/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record.graphql deleted file mode 100644 index 05f492f11..000000000 --- a/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - city( - address: { - number: "308" - street: "Negra Arroyo Lane" - city: "Albequerque" - } - ) -} diff --git a/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record_field.graphql b/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record_field.graphql deleted file mode 100644 index e18974319..000000000 --- a/ballerina-tests/tests/resources/documents/non_null_input_for_nullable_record_field.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - accountNumber( - account: { number: 123456, contact: { number: "07123456789"} } - ) -} diff --git a/ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql b/ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql deleted file mode 100644 index 3a906dbd5..000000000 --- a/ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_1.graphql +++ /dev/null @@ -1,6 +0,0 @@ -query($tvSeries: [TvSeries!]!) { - getSuggestions(tvSeries: $tvSeries) { - movieName - director - } -} diff --git a/ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql b/ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql deleted file mode 100644 index a87b16ac2..000000000 --- a/ballerina-tests/tests/resources/documents/non_null_list_type_variable_with_empty_list_value_2.graphql +++ /dev/null @@ -1,6 +0,0 @@ -{ - getSuggestions(tvSeries: []) { - movieName, - director - } -} diff --git a/ballerina-tests/tests/resources/documents/null_as_enum_input.graphql b/ballerina-tests/tests/resources/documents/null_as_enum_input.graphql deleted file mode 100644 index e6b513c4e..000000000 --- a/ballerina-tests/tests/resources/documents/null_as_enum_input.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - isHoliday(weekday: null) -} diff --git a/ballerina-tests/tests/resources/documents/null_as_resource_function_name.graphql b/ballerina-tests/tests/resources/documents/null_as_resource_function_name.graphql deleted file mode 100644 index 5cb0d86fb..000000000 --- a/ballerina-tests/tests/resources/documents/null_as_resource_function_name.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - null(value: null) -} diff --git a/ballerina-tests/tests/resources/documents/null_as_scalar_input.graphql b/ballerina-tests/tests/resources/documents/null_as_scalar_input.graphql deleted file mode 100644 index c825426c8..000000000 --- a/ballerina-tests/tests/resources/documents/null_as_scalar_input.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - profile(id: null) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/null_input_for_nullable_record_field.graphql b/ballerina-tests/tests/resources/documents/null_input_for_nullable_record_field.graphql deleted file mode 100644 index 4c675eee5..000000000 --- a/ballerina-tests/tests/resources/documents/null_input_for_nullable_record_field.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - accountNumber( - account: { number: 123456, contact: null } - ) -} diff --git a/ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments.graphql b/ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments.graphql deleted file mode 100644 index 28d1d0d3f..000000000 --- a/ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation { - profile(name: null) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql b/ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql deleted file mode 100644 index f07487259..000000000 --- a/ballerina-tests/tests/resources/documents/null_value_for_defaultable_arguments_with_variable.graphql +++ /dev/null @@ -1,5 +0,0 @@ -mutation($name: String) { - profile(name: $name) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/null_value_for_non_null_argument.graphql b/ballerina-tests/tests/resources/documents/null_value_for_non_null_argument.graphql deleted file mode 100644 index 4e65bd341..000000000 --- a/ballerina-tests/tests/resources/documents/null_value_for_non_null_argument.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - greet(name: null) -} diff --git a/ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql b/ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql deleted file mode 100644 index c24a12cce..000000000 --- a/ballerina-tests/tests/resources/documents/null_value_for_nullable_input_object_with_error_added_to_context.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - name(id: null) -} diff --git a/ballerina-tests/tests/resources/documents/null_value_in_input_object_field.graphql b/ballerina-tests/tests/resources/documents/null_value_in_input_object_field.graphql deleted file mode 100644 index 41066c468..000000000 --- a/ballerina-tests/tests/resources/documents/null_value_in_input_object_field.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - book(author: { name: null, id: 1 }) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/nullable_input_for_nullable_list.graphql b/ballerina-tests/tests/resources/documents/nullable_input_for_nullable_list.graphql deleted file mode 100644 index 30a03edca..000000000 --- a/ballerina-tests/tests/resources/documents/nullable_input_for_nullable_list.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - cities(addresses: null) -} diff --git a/ballerina-tests/tests/resources/documents/nullable_input_for_nullable_record.graphql b/ballerina-tests/tests/resources/documents/nullable_input_for_nullable_record.graphql deleted file mode 100644 index 8bda4877c..000000000 --- a/ballerina-tests/tests/resources/documents/nullable_input_for_nullable_record.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - city(address: null) -} diff --git a/ballerina-tests/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql b/ballerina-tests/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql deleted file mode 100644 index 656f7639e..000000000 --- a/ballerina-tests/tests/resources/documents/nullable_list_type_input_with_invalid_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - concat(words: ["Hello!", 5, true, {}, "GraphQL"]) -} diff --git a/ballerina-tests/tests/resources/documents/nullable_list_type_input_without_value.graphql b/ballerina-tests/tests/resources/documents/nullable_list_type_input_without_value.graphql deleted file mode 100644 index 526e01dd6..000000000 --- a/ballerina-tests/tests/resources/documents/nullable_list_type_input_without_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - concat -} diff --git a/ballerina-tests/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql b/ballerina-tests/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql deleted file mode 100644 index 7fa6c74c5..000000000 --- a/ballerina-tests/tests/resources/documents/nullable_union_of_distinct_services_array_query_on_selected_types.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - services { - ... on TeacherService { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/optional_arrays_with_invalid_query.graphql b/ballerina-tests/tests/resources/documents/optional_arrays_with_invalid_query.graphql deleted file mode 100644 index b32df576a..000000000 --- a/ballerina-tests/tests/resources/documents/optional_arrays_with_invalid_query.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - searchVehicles(keyword: "vehicle") -} diff --git a/ballerina-tests/tests/resources/documents/optional_enum_argument_with_value.graphql b/ballerina-tests/tests/resources/documents/optional_enum_argument_with_value.graphql deleted file mode 100644 index 090d8b2b9..000000000 --- a/ballerina-tests/tests/resources/documents/optional_enum_argument_with_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - isHoliday(weekday: SUNDAY) -} diff --git a/ballerina-tests/tests/resources/documents/optional_enum_argument_without_value.graphql b/ballerina-tests/tests/resources/documents/optional_enum_argument_without_value.graphql deleted file mode 100644 index 5ffe9a5c5..000000000 --- a/ballerina-tests/tests/resources/documents/optional_enum_argument_without_value.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - isHoliday -} diff --git a/ballerina-tests/tests/resources/documents/query_type_introspection.graphql b/ballerina-tests/tests/resources/documents/query_type_introspection.graphql deleted file mode 100644 index 82174d0f1..000000000 --- a/ballerina-tests/tests/resources/documents/query_type_introspection.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - __schema { - queryType { - kind - fields { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/query_union_type.graphql b/ballerina-tests/tests/resources/documents/query_union_type.graphql deleted file mode 100644 index d69b8b0b1..000000000 --- a/ballerina-tests/tests/resources/documents/query_union_type.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query { - information(id: 3) { - ...addressFragment - ...personFragment - } -} - -fragment addressFragment on Address { - city -} - -fragment personFragment on Person { - name -} diff --git a/ballerina-tests/tests/resources/documents/query_with_default_parameter.graphql b/ballerina-tests/tests/resources/documents/query_with_default_parameter.graphql deleted file mode 100644 index 7503e04bb..000000000 --- a/ballerina-tests/tests/resources/documents/query_with_default_parameter.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - quoteById(id: 2) -} diff --git a/ballerina-tests/tests/resources/documents/query_without_default_parameter.graphql b/ballerina-tests/tests/resources/documents/query_without_default_parameter.graphql deleted file mode 100644 index 1fa72c6d5..000000000 --- a/ballerina-tests/tests/resources/documents/query_without_default_parameter.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - quoteById -} diff --git a/ballerina-tests/tests/resources/documents/querying_subfields_on_type_name.graphql b/ballerina-tests/tests/resources/documents/querying_subfields_on_type_name.graphql deleted file mode 100644 index 8e8be7f59..000000000 --- a/ballerina-tests/tests/resources/documents/querying_subfields_on_type_name.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - detective { - __typename { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/querying_table_without_selections.graphql b/ballerina-tests/tests/resources/documents/querying_table_without_selections.graphql deleted file mode 100644 index 5671ba65d..000000000 --- a/ballerina-tests/tests/resources/documents/querying_table_without_selections.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - employees -} diff --git a/ballerina-tests/tests/resources/documents/record_type_arrays.graphql b/ballerina-tests/tests/resources/documents/record_type_arrays.graphql deleted file mode 100644 index d51d80856..000000000 --- a/ballerina-tests/tests/resources/documents/record_type_arrays.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - people { - name - address { - city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/request_invalid_field.graphql b/ballerina-tests/tests/resources/documents/request_invalid_field.graphql deleted file mode 100644 index fbf08583a..000000000 --- a/ballerina-tests/tests/resources/documents/request_invalid_field.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - profile(id: 4) { - status - } -} diff --git a/ballerina-tests/tests/resources/documents/request_invalid_field_from_service_objects.graphql b/ballerina-tests/tests/resources/documents/request_invalid_field_from_service_objects.graphql deleted file mode 100644 index 39ad626f0..000000000 --- a/ballerina-tests/tests/resources/documents/request_invalid_field_from_service_objects.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query { - allLifts(status: OPEN) { - name - id - invalid - trailAccess { - name - difficulty - } - } -} diff --git a/ballerina-tests/tests/resources/documents/requesting_object_without_fields.graphql b/ballerina-tests/tests/resources/documents/requesting_object_without_fields.graphql deleted file mode 100644 index e40152d08..000000000 --- a/ballerina-tests/tests/resources/documents/requesting_object_without_fields.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - profile(id: 4) -} diff --git a/ballerina-tests/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql b/ballerina-tests/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql deleted file mode 100644 index 022a536cd..000000000 --- a/ballerina-tests/tests/resources/documents/resolver_returning_list_of_nested_service_objects.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - top3 { - product { - id - } - score - } -} diff --git a/ballerina-tests/tests/resources/documents/resolver_returning_map_of_service_objects.graphql b/ballerina-tests/tests/resources/documents/resolver_returning_map_of_service_objects.graphql deleted file mode 100644 index dc7673bc2..000000000 --- a/ballerina-tests/tests/resources/documents/resolver_returning_map_of_service_objects.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - account { - details(key: "acc1") { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql b/ballerina-tests/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql deleted file mode 100644 index 7ae78e53d..000000000 --- a/ballerina-tests/tests/resources/documents/resolver_returning_table_of_nested_service_objects.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - all { - product { - id - } - score - } -} diff --git a/ballerina-tests/tests/resources/documents/resolver_returning_tables_with_errors.graphql b/ballerina-tests/tests/resources/documents/resolver_returning_tables_with_errors.graphql deleted file mode 100644 index 16db20a6b..000000000 --- a/ballerina-tests/tests/resources/documents/resolver_returning_tables_with_errors.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - tasks { - subTasks - } -} diff --git a/ballerina-tests/tests/resources/documents/resource_interceptors.graphql b/ballerina-tests/tests/resources/documents/resource_interceptors.graphql deleted file mode 100644 index ea1a1db92..000000000 --- a/ballerina-tests/tests/resources/documents/resource_interceptors.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query { - customer { - id - name - address { - number - street - city - } - } - newPerson { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/resource_returning_arrays_missing_fields.graphql b/ballerina-tests/tests/resources/documents/resource_returning_arrays_missing_fields.graphql deleted file mode 100644 index 6a9503ae0..000000000 --- a/ballerina-tests/tests/resources/documents/resource_returning_arrays_missing_fields.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - people -} diff --git a/ballerina-tests/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql b/ballerina-tests/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql deleted file mode 100644 index 11f350625..000000000 --- a/ballerina-tests/tests/resources/documents/resource_returning_optional_service_object_arrays.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - searchVehicles(keyword: "vehicle") { - ...on Vehicle { - id - } - } -} diff --git a/ballerina-tests/tests/resources/documents/resource_returning_service_object.graphql b/ballerina-tests/tests/resources/documents/resource_returning_service_object.graphql deleted file mode 100644 index abfcc86eb..000000000 --- a/ballerina-tests/tests/resources/documents/resource_returning_service_object.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - greet { - generalGreeting - } -} diff --git a/ballerina-tests/tests/resources/documents/resource_returning_service_object_array.graphql b/ballerina-tests/tests/resources/documents/resource_returning_service_object_array.graphql deleted file mode 100644 index 756d43cf2..000000000 --- a/ballerina-tests/tests/resources/documents/resource_returning_service_object_array.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - allVehicles { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/resource_returning_tables.graphql b/ballerina-tests/tests/resources/documents/resource_returning_tables.graphql deleted file mode 100644 index 6f91677e1..000000000 --- a/ballerina-tests/tests/resources/documents/resource_returning_tables.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - employees { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/returning_enum_array.graphql b/ballerina-tests/tests/resources/documents/returning_enum_array.graphql deleted file mode 100644 index 0ae613cd1..000000000 --- a/ballerina-tests/tests/resources/documents/returning_enum_array.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - holidays -} diff --git a/ballerina-tests/tests/resources/documents/returning_enum_array_with_errors.graphql b/ballerina-tests/tests/resources/documents/returning_enum_array_with_errors.graphql deleted file mode 100644 index 8c39c5a9b..000000000 --- a/ballerina-tests/tests/resources/documents/returning_enum_array_with_errors.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - openingDays -} diff --git a/ballerina-tests/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql b/ballerina-tests/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql deleted file mode 100644 index ea58ae406..000000000 --- a/ballerina-tests/tests/resources/documents/returning_nullable_enum_array_with_errors.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - specialHolidays -} diff --git a/ballerina-tests/tests/resources/documents/returning_recursive_service_type.graphql b/ballerina-tests/tests/resources/documents/returning_recursive_service_type.graphql deleted file mode 100644 index 79fbf6601..000000000 --- a/ballerina-tests/tests/resources/documents/returning_recursive_service_type.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - trail(id: "blue-bird") { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/returning_union_of_service_objects.graphql b/ballerina-tests/tests/resources/documents/returning_union_of_service_objects.graphql deleted file mode 100644 index db8cf64c7..000000000 --- a/ballerina-tests/tests/resources/documents/returning_union_of_service_objects.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query { - search (status: OPEN) { - ...TrailFragment - ...LiftFragment - } -} - -fragment TrailFragment on Trail { - name -} - -fragment LiftFragment on Lift { - name -} diff --git a/ballerina-tests/tests/resources/documents/same_field_with_multiple_alias.graphql b/ballerina-tests/tests/resources/documents/same_field_with_multiple_alias.graphql deleted file mode 100644 index 4be30f2e3..000000000 --- a/ballerina-tests/tests/resources/documents/same_field_with_multiple_alias.graphql +++ /dev/null @@ -1,14 +0,0 @@ -{ - sherlock: profile(id: 0) { - name - residence: address { - hometown: city - } - } - walter: profile(id: 1) { - name - residence: address { - hometown: city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql b/ballerina-tests/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql deleted file mode 100644 index 99930edd7..000000000 --- a/ballerina-tests/tests/resources/documents/same_field_with_multiple_alias_different_subfields.graphql +++ /dev/null @@ -1,14 +0,0 @@ -{ - sherlock: profile(id: 0) { - name - residence: address { - apartment: number - } - } - walter: profile(id: 1) { - name - residence: address { - hometown: city - } - } -} diff --git a/ballerina-tests/tests/resources/documents/scalar_arrays.graphql b/ballerina-tests/tests/resources/documents/scalar_arrays.graphql deleted file mode 100644 index 8dd051ef9..000000000 --- a/ballerina-tests/tests/resources/documents/scalar_arrays.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - ids -} diff --git a/ballerina-tests/tests/resources/documents/scalar_arrays_with_errors.graphql b/ballerina-tests/tests/resources/documents/scalar_arrays_with_errors.graphql deleted file mode 100644 index 1259da7bd..000000000 --- a/ballerina-tests/tests/resources/documents/scalar_arrays_with_errors.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - idsWithErrors -} diff --git a/ballerina-tests/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql b/ballerina-tests/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql deleted file mode 100644 index c7736f29f..000000000 --- a/ballerina-tests/tests/resources/documents/scalar_nullable_arrays_with_errors.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - friends -} diff --git a/ballerina-tests/tests/resources/documents/server_cache.graphql b/ballerina-tests/tests/resources/documents/server_cache.graphql deleted file mode 100644 index 462dc9e88..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query A { - greet - name(id:1) -} - -mutation B { - updateName(name: "John", enableEvict: false) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction.graphql deleted file mode 100644 index 9c7b30b90..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query A { - greet - name(id:1) -} - -mutation B { - updateName(name: "John", enableEvict: true) -} - -mutation C { - updateName(name: "Walter White", enableEvict: false) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_arrays.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction_with_arrays.graphql deleted file mode 100644 index 93946a573..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_arrays.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - getFriendServices { - name - age - } -} - -mutation B { - updateFriend(name: "Tyler", age: 28, isMarried: true, enableEvict: true) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_interceptors.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction_with_interceptors.graphql deleted file mode 100644 index 9e8b9c029..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_interceptors.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query A { - enemy -} - -mutation B { - updateEnemy(name: "Snape", enableEvict: true) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql deleted file mode 100644 index 3ae4aca16..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_list_inputs.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query A ($names:[String!]!){ - isAllMarried(names: $names) -} - -mutation B { - updateEnemy(enemy: {name: "Enemy3", age: 44}, enableEvict: true) { - name - isMarried - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql deleted file mode 100644 index 22469f1b1..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_nullable_inputs.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - enemies(isMarried: null) { - name - isMarried - } -} - -mutation B { - removeEnemy(name: "Enemy2", enableEvict: false) { - name - isMarried - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_service_obj.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction_with_service_obj.graphql deleted file mode 100644 index f836c622f..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_service_obj.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - getFriendService(name: "Jesse Pinkman") { - name - age - } -} - -mutation B { - updateFriend(name: "Jesse Pinkman", age: 30, isMarried: false, enableEvict: true) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_union.graphql b/ballerina-tests/tests/resources/documents/server_cache_eviction_with_union.graphql deleted file mode 100644 index 91b6f9bd1..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_eviction_with_union.graphql +++ /dev/null @@ -1,15 +0,0 @@ -query A { - getServices(isEnemy: true) { - ...on EnemyService { - name - age - } - } -} - -mutation B { - addEnemy(name: "Jake", age: 22, isMarried: false, enableEvict: true) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_input_object_parameters.graphql b/ballerina-tests/tests/resources/documents/server_cache_input_object_parameters.graphql deleted file mode 100644 index 2ca1f95b9..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_input_object_parameters.graphql +++ /dev/null @@ -1,18 +0,0 @@ -input Associate { - name: String! - status: String -} - -query B { - status(associates: [ - { name: "Gus Fring", status: "dead"}, - { name: "Saul Goodman", status: "alive"} - ]) -} - -query C { - status(associates: [ - { name: "Gus Fring", status: "alive"}, - { name: "Saul Goodman", status: "alive"} - ]) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_list_inputs.graphql b/ballerina-tests/tests/resources/documents/server_cache_list_inputs.graphql deleted file mode 100644 index a6f1a7e24..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_list_inputs.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - cities( - addresses: [ - { name: "Gus Fring", status: "dead" }, - { name: "Saul Goodman", status: "alive" } - ] - ) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_operations_with_TTL.graphql b/ballerina-tests/tests/resources/documents/server_cache_operations_with_TTL.graphql deleted file mode 100644 index 347569bff..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_operations_with_TTL.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query A { - greet - name(id:1) -} - -mutation B { - updateName(name: "Heisenberg", enableEvict: false) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_arrays.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_arrays.graphql deleted file mode 100644 index 493ae50a8..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_arrays.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - getFriendServices { - name - age - } -} - -mutation B { - updateFriend(name: "Tyler", age: 28, isMarried: true, enableEvict: false) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_dynamic_responses.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_dynamic_responses.graphql deleted file mode 100644 index b991f1d98..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_dynamic_responses.graphql +++ /dev/null @@ -1,44 +0,0 @@ -query A { - user(id:1) { - id - } -} - -query B { - user(id:1) { - id - name - } -} - -query C { - user(id:1) { - id - name - age - } -} - -mutation D { - updateUser(id:1, name:"White", age:45, enableEvict:false) { - id - name - age - } -} - -mutation E { - updateUser(id:1, name:"White", age:45, enableEvict:true) { - id - name - age - } -} - -mutation F { - updateUser(id:1, name:"Walter", age:45, enableEvict:true) { - id - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_errors.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_errors.graphql deleted file mode 100644 index ae9c0dcf9..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_errors.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query A { - isAdult(age:null) -} - -query B { - isAdult(age:1) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_errors_2.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_errors_2.graphql deleted file mode 100644 index 805ee6aaa..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_errors_2.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - getFriendService(name: "Lalo Salamanca") { - name - age - } -} - -mutation B { - addFriend(name: "Lalo Salamanca", age: 44, isMarried: false, enableEvict: false) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_input_object.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_input_object.graphql deleted file mode 100644 index 3cd54f189..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_input_object.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query A { - searchEnemy(enemyInput: {name: "Enemy6", age: 14}) { - name - age - } -} - -mutation B { - removeEnemy(name: "Enemy6", enableEvict: false) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_inputs.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_inputs.graphql deleted file mode 100644 index 4feef8842..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_inputs.graphql +++ /dev/null @@ -1,21 +0,0 @@ -query A { - status(associates: null) -} - -query B { - status(associates: [ - { name: "Gus Fring", status: "dead"}, - { name: "Saul Goodman", status: "alive"} - ]) -} - -query C { - status(associates: [ - { name: "Gus Fring", status: "alive"}, - { name: "Saul Goodman", status: "alive"} - ]) -} - -query D { - status(associates: []) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_interceptors.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_interceptors.graphql deleted file mode 100644 index 8bda3a925..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_interceptors.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query A { - enemy -} - -mutation B { - updateEnemy(name: "Snape", enableEvict: false) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_list_input.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_list_input.graphql deleted file mode 100644 index 45c761845..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_list_input.graphql +++ /dev/null @@ -1,63 +0,0 @@ -query A { - users1(ids: [1]) { - id - name - age - } -} - -query B { - users1(ids: [2]) { - id - name - age - } -} - -query C { - users1(ids: [3]) { - id - name - age - } -} - -query D { - users2(ids: [[1], [3], [2]]) { - id - name - age - } -} - -query E { - users2(ids: [[1], [2], [3]]) { - id - name - age - } -} - -query F { - cities(addresses: [{number: "1", street: "Main St", city: "London"}]) -} - -mutation G { - updateUser(id: 1, name: "Shane", age: 30) { - id - name - age - } -} - -mutation H { - updateUser(id: 1, name: "Rock", age: 22) { - id - name - age - } -} - -query I { - cities(addresses: [{number: "2", street: "Main St", city: "london"}]) -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_list_inputs.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_list_inputs.graphql deleted file mode 100644 index 521ac7b1b..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_list_inputs.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query A ($names:[String!]!){ - isAllMarried(names: $names) -} - -mutation B { - updateEnemy(enemy: {name: "Enemy3", age: 44}, enableEvict: false) { - name - isMarried - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_null_values.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_null_values.graphql deleted file mode 100644 index 6a30b4d6f..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_null_values.graphql +++ /dev/null @@ -1,12 +0,0 @@ -query A { - searchEnemy(enemyInput: {}) { - name - age - } -} - -mutation B { - addEnemy2(name: "Enemy6", age:12, isMarried: false, enableEvict: false) { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_nullable_inputs.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_nullable_inputs.graphql deleted file mode 100644 index c529a74bc..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_nullable_inputs.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - enemies { - name - isMarried - } -} - -mutation B { - removeEnemy(name: "Enemy1", enableEvict: false) { - name - isMarried - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_partial_responses.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_partial_responses.graphql deleted file mode 100644 index 1e95f3327..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_partial_responses.graphql +++ /dev/null @@ -1,17 +0,0 @@ -query A { - getFriendService(name: "Jesse Pinkman") { - age - } -} - -mutation B { - updateFriend(name: "Jesse Pinkman", age: 45, isMarried: false, enableEvict: false) { - age - } -} - -mutation C { - updateFriend(name: "Jesse Pinkman", age: 45, isMarried: false, enableEvict: true) { - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_records.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_records.graphql deleted file mode 100644 index fb4b8d8eb..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_records.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - friends(isMarried: true) { - name - age - } -} - -mutation B { - addFriend(name: "John", age: 30, isMarried: true) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_records_eviction.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_records_eviction.graphql deleted file mode 100644 index 6d1f62656..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_records_eviction.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - friends(isMarried: true) { - name - age - } -} - -mutation B { - addFriend(name: "Elliott Schwartz", age: 51, isMarried: true, enableEvict: true) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_records_operations.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_records_operations.graphql deleted file mode 100644 index 167d4b760..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_records_operations.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - friends(isMarried: true) { - name - age - } -} - -mutation B { - updateFriend(name: "Walter White Jr.", age: 25, isMarried: true, enableEvict: false) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_service_obj.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_service_obj.graphql deleted file mode 100644 index 5968570a0..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_service_obj.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query A { - getFriendService(name: "Jesse Pinkman") { - name - age - } -} - -mutation B { - updateFriend(name: "Jesse Pinkman", age: 30, isMarried: false, enableEvict: false) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_union.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_union.graphql deleted file mode 100644 index 3f842a99c..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_union.graphql +++ /dev/null @@ -1,15 +0,0 @@ -query A { - getServices(isEnemy: true) { - ...on EnemyService { - name - age - } - } -} - -mutation B { - addEnemy(name: "Gandalf", age: 68, isMarried: false, enableEvict: false) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/server_cache_with_unions_operational_level.graphql b/ballerina-tests/tests/resources/documents/server_cache_with_unions_operational_level.graphql deleted file mode 100644 index 85d744583..000000000 --- a/ballerina-tests/tests/resources/documents/server_cache_with_unions_operational_level.graphql +++ /dev/null @@ -1,32 +0,0 @@ -query A { - relationship(name: "Gus Fring") { - ...FriendFragment - ...AssociateFragment - } -} - -mutation B { - updateAssociate(name: "Gus Fring", status: "alive", enableEvict: false) { - name - status - } -} - -mutation C { - updateAssociate(name: "Gus Fring", status: "alive", enableEvict: true) { - name - status - } -} - -fragment FriendFragment on FriendService { - name - age - isMarried -} - -fragment AssociateFragment on AssociateService { - name - status -} - diff --git a/ballerina-tests/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql b/ballerina-tests/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql deleted file mode 100644 index bfc59ab97..000000000 --- a/ballerina-tests/tests/resources/documents/service_object_array_with_fragment_returning_error.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - allVehicles { - ...Details - } -} - -fragment Details on Vehicle { - name, - registeredYear -} diff --git a/ballerina-tests/tests/resources/documents/service_object_array_with_invalid_response_order.graphql b/ballerina-tests/tests/resources/documents/service_object_array_with_invalid_response_order.graphql deleted file mode 100644 index bfc59ab97..000000000 --- a/ballerina-tests/tests/resources/documents/service_object_array_with_invalid_response_order.graphql +++ /dev/null @@ -1,10 +0,0 @@ -{ - allVehicles { - ...Details - } -} - -fragment Details on Vehicle { - name, - registeredYear -} diff --git a/ballerina-tests/tests/resources/documents/service_object_defined_as_record_field.graphql b/ballerina-tests/tests/resources/documents/service_object_defined_as_record_field.graphql deleted file mode 100644 index 902ce9265..000000000 --- a/ballerina-tests/tests/resources/documents/service_object_defined_as_record_field.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - latest { - product { - id - } - score - } -} diff --git a/ballerina-tests/tests/resources/documents/service_with_other_annotations.graphql b/ballerina-tests/tests/resources/documents/service_with_other_annotations.graphql deleted file mode 100644 index ad47d0af1..000000000 --- a/ballerina-tests/tests/resources/documents/service_with_other_annotations.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - greeting -} diff --git a/ballerina-tests/tests/resources/documents/subscriptions_with_fragments.graphql b/ballerina-tests/tests/resources/documents/subscriptions_with_fragments.graphql deleted file mode 100644 index 81391132c..000000000 --- a/ballerina-tests/tests/resources/documents/subscriptions_with_fragments.graphql +++ /dev/null @@ -1,14 +0,0 @@ -subscription getStudents { - ...personFields -} - -fragment personFields on Subscription { - ...studentFields -} - -fragment studentFields on Subscription { - students { - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/subscriptions_with_multiple_operations.graphql b/ballerina-tests/tests/resources/documents/subscriptions_with_multiple_operations.graphql deleted file mode 100644 index 702100fc3..000000000 --- a/ballerina-tests/tests/resources/documents/subscriptions_with_multiple_operations.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query getName { - name -} - -subscription getMessages { - messages -} - -subscription getStringMessages { - stringMessages -} diff --git a/ballerina-tests/tests/resources/documents/subscriptions_with_records.graphql b/ballerina-tests/tests/resources/documents/subscriptions_with_records.graphql deleted file mode 100644 index 43a99fd3c..000000000 --- a/ballerina-tests/tests/resources/documents/subscriptions_with_records.graphql +++ /dev/null @@ -1,6 +0,0 @@ -subscription { - books { - name - author - } -} diff --git a/ballerina-tests/tests/resources/documents/subscriptions_with_service_objects.graphql b/ballerina-tests/tests/resources/documents/subscriptions_with_service_objects.graphql deleted file mode 100644 index 808118c13..000000000 --- a/ballerina-tests/tests/resources/documents/subscriptions_with_service_objects.graphql +++ /dev/null @@ -1,6 +0,0 @@ -subscription getStudents { - students { - id - name - } -} diff --git a/ballerina-tests/tests/resources/documents/subscriptions_with_variable_values.graphql b/ballerina-tests/tests/resources/documents/subscriptions_with_variable_values.graphql deleted file mode 100644 index 710752ac6..000000000 --- a/ballerina-tests/tests/resources/documents/subscriptions_with_variable_values.graphql +++ /dev/null @@ -1,3 +0,0 @@ -subscription getFilteredValues($value: Int!) { - filterValues(value: $value) -} diff --git a/ballerina-tests/tests/resources/documents/type_introspection.graphql b/ballerina-tests/tests/resources/documents/type_introspection.graphql deleted file mode 100644 index e1128413a..000000000 --- a/ballerina-tests/tests/resources/documents/type_introspection.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - __type(name: "Person") { - kind - fields { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/type_introspection_in_invalid_place.graphql b/ballerina-tests/tests/resources/documents/type_introspection_in_invalid_place.graphql deleted file mode 100644 index 5aaeae9e1..000000000 --- a/ballerina-tests/tests/resources/documents/type_introspection_in_invalid_place.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - profile(id: 1) { - __type(name: "Person") { - kind - } - } -} diff --git a/ballerina-tests/tests/resources/documents/type_introspection_on_non_existing_type.graphql b/ballerina-tests/tests/resources/documents/type_introspection_on_non_existing_type.graphql deleted file mode 100644 index b4dde8924..000000000 --- a/ballerina-tests/tests/resources/documents/type_introspection_on_non_existing_type.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - __type(name: "INVALID") { - kind - } -} diff --git a/ballerina-tests/tests/resources/documents/type_introspection_with_alias.graphql b/ballerina-tests/tests/resources/documents/type_introspection_with_alias.graphql deleted file mode 100644 index a22dd86c6..000000000 --- a/ballerina-tests/tests/resources/documents/type_introspection_with_alias.graphql +++ /dev/null @@ -1,6 +0,0 @@ -{ - FieldType: __type(name: "__Field") { - name - kind - } -} diff --git a/ballerina-tests/tests/resources/documents/type_introspection_without_fields.graphql b/ballerina-tests/tests/resources/documents/type_introspection_without_fields.graphql deleted file mode 100644 index 1de6551f7..000000000 --- a/ballerina-tests/tests/resources/documents/type_introspection_without_fields.graphql +++ /dev/null @@ -1,3 +0,0 @@ -{ - __type(name: "Person") -} diff --git a/ballerina-tests/tests/resources/documents/type_introspection_without_type_name_argument.graphql b/ballerina-tests/tests/resources/documents/type_introspection_without_type_name_argument.graphql deleted file mode 100644 index 97fe651ac..000000000 --- a/ballerina-tests/tests/resources/documents/type_introspection_without_type_name_argument.graphql +++ /dev/null @@ -1,8 +0,0 @@ -{ - __type { - kind - fields { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql b/ballerina-tests/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql deleted file mode 100644 index b2e4a0691..000000000 --- a/ballerina-tests/tests/resources/documents/type_name_introspection_on_nullable_union_of_service_types.graphql +++ /dev/null @@ -1,15 +0,0 @@ -{ - services { - __typename - ...StudentFragment - ...TeacherFragment - } -} - -fragment StudentFragment on StudentService { - name -} - -fragment TeacherFragment on TeacherService { - subject -} diff --git a/ballerina-tests/tests/resources/documents/type_name_introspection_on_record_types.graphql b/ballerina-tests/tests/resources/documents/type_name_introspection_on_record_types.graphql deleted file mode 100644 index 5f82149eb..000000000 --- a/ballerina-tests/tests/resources/documents/type_name_introspection_on_record_types.graphql +++ /dev/null @@ -1,5 +0,0 @@ -{ - detective { - __typename - } -} diff --git a/ballerina-tests/tests/resources/documents/type_name_introspection_on_service_types.graphql b/ballerina-tests/tests/resources/documents/type_name_introspection_on_service_types.graphql deleted file mode 100644 index 8340e22fb..000000000 --- a/ballerina-tests/tests/resources/documents/type_name_introspection_on_service_types.graphql +++ /dev/null @@ -1,6 +0,0 @@ -{ - teacher { - name - __typename - } -} diff --git a/ballerina-tests/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql b/ballerina-tests/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql deleted file mode 100644 index cc00cb1ee..000000000 --- a/ballerina-tests/tests/resources/documents/type_name_introspection_on_union_of_service_types.graphql +++ /dev/null @@ -1,15 +0,0 @@ -{ - search { - __typename - ...StudentFragment - ...TeacherFragment - } -} - -fragment StudentFragment on StudentService { - name -} - -fragment TeacherFragment on TeacherService { - subject -} diff --git a/ballerina-tests/tests/resources/documents/typename_introspection_on_field.graphql b/ballerina-tests/tests/resources/documents/typename_introspection_on_field.graphql deleted file mode 100644 index b81bef23a..000000000 --- a/ballerina-tests/tests/resources/documents/typename_introspection_on_field.graphql +++ /dev/null @@ -1,9 +0,0 @@ -{ - __type(name: "Person") { - name - fields { - name - __typename - } - } -} diff --git a/ballerina-tests/tests/resources/documents/typename_introspection_on_scalar.graphql b/ballerina-tests/tests/resources/documents/typename_introspection_on_scalar.graphql deleted file mode 100644 index 92716587e..000000000 --- a/ballerina-tests/tests/resources/documents/typename_introspection_on_scalar.graphql +++ /dev/null @@ -1,7 +0,0 @@ -{ - detective { - name { - __typename - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_of_distinct_service_objects.graphql b/ballerina-tests/tests/resources/documents/union_of_distinct_service_objects.graphql deleted file mode 100644 index 2b03a86d5..000000000 --- a/ballerina-tests/tests/resources/documents/union_of_distinct_service_objects.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query { - profile(id: 200) { - ... on StudentService { - name - } - ... on TeacherService { - name - subject - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql b/ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql deleted file mode 100644 index 5dcf0e917..000000000 --- a/ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - search { - ... on TeacherService { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql b/ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql deleted file mode 100644 index c559c8dcb..000000000 --- a/ballerina-tests/tests/resources/documents/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query { - ... on Query { - search { - ... on TeacherService { - name - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql b/ballerina-tests/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql deleted file mode 100644 index d570eaa50..000000000 --- a/ballerina-tests/tests/resources/documents/union_of_distinct_services_query_on_selected_types.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - profile(id: 200) { - ... on StudentService { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_type_as_record_field.graphql b/ballerina-tests/tests/resources/documents/union_type_as_record_field.graphql deleted file mode 100644 index 88628479a..000000000 --- a/ballerina-tests/tests/resources/documents/union_type_as_record_field.graphql +++ /dev/null @@ -1,16 +0,0 @@ -query { - details(id: 10) { - information { - ...addressFragment - ...personFragment - } - } -} - -fragment addressFragment on Address { - city -} - -fragment personFragment on Person { - name -} diff --git a/ballerina-tests/tests/resources/documents/union_type_as_record_field_without_fragment.graphql b/ballerina-tests/tests/resources/documents/union_type_as_record_field_without_fragment.graphql deleted file mode 100644 index 29cc49d7d..000000000 --- a/ballerina-tests/tests/resources/documents/union_type_as_record_field_without_fragment.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query { - details(id: 3) { - information { - name - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_type_names.graphql b/ballerina-tests/tests/resources/documents/union_type_names.graphql deleted file mode 100644 index 3177074e7..000000000 --- a/ballerina-tests/tests/resources/documents/union_type_names.graphql +++ /dev/null @@ -1,25 +0,0 @@ -{ - __schema { - queryType { - fields { - name - type { - name - kind - ofType { - name - kind - ofType { - name - kind - ofType { - name - kind - } - } - } - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_type_with_field_and_fragment.graphql b/ballerina-tests/tests/resources/documents/union_type_with_field_and_fragment.graphql deleted file mode 100644 index 38a5401e8..000000000 --- a/ballerina-tests/tests/resources/documents/union_type_with_field_and_fragment.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query { - information(id: 3) { - name - ...personFragment - } -} - -fragment personFragment on Person { - name -} diff --git a/ballerina-tests/tests/resources/documents/union_type_with_fragment_and_field.graphql b/ballerina-tests/tests/resources/documents/union_type_with_fragment_and_field.graphql deleted file mode 100644 index 569571ead..000000000 --- a/ballerina-tests/tests/resources/documents/union_type_with_fragment_and_field.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query { - information(id: 3) { - ...personFragment - name - } -} - -fragment personFragment on Person { - name -} diff --git a/ballerina-tests/tests/resources/documents/union_type_with_incorrect_fragment.graphql b/ballerina-tests/tests/resources/documents/union_type_with_incorrect_fragment.graphql deleted file mode 100644 index 3fe18cee3..000000000 --- a/ballerina-tests/tests/resources/documents/union_type_with_incorrect_fragment.graphql +++ /dev/null @@ -1,14 +0,0 @@ -query { - information(id: 3) { - ...invalidFragment - ...personFragment - } -} - -fragment invalidFragment on Student { - name -} - -fragment personFragment on Person { - name -} diff --git a/ballerina-tests/tests/resources/documents/union_types_with_field_returning_enum.graphql b/ballerina-tests/tests/resources/documents/union_types_with_field_returning_enum.graphql deleted file mode 100644 index c9dc1865d..000000000 --- a/ballerina-tests/tests/resources/documents/union_types_with_field_returning_enum.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query { - profile(id: 101) { - ... on TeacherService { - name - holidays - } - } -} diff --git a/ballerina-tests/tests/resources/documents/union_types_with_missing_types_in_document.graphql b/ballerina-tests/tests/resources/documents/union_types_with_missing_types_in_document.graphql deleted file mode 100644 index 5dca1d078..000000000 --- a/ballerina-tests/tests/resources/documents/union_types_with_missing_types_in_document.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query { - learningSources { - ...courseFragment - } -} - -fragment courseFragment on Course { - name -} diff --git a/ballerina-tests/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql b/ballerina-tests/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql deleted file mode 100644 index 8b9347c7e..000000000 --- a/ballerina-tests/tests/resources/documents/union_types_with_nested_object_includes_field_returning_enum.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query { - profile(id: 101) { - ... on TeacherService { - holidays - school { - name - openingDays - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/unknown_fragment.graphql b/ballerina-tests/tests/resources/documents/unknown_fragment.graphql deleted file mode 100644 index 12fff49df..000000000 --- a/ballerina-tests/tests/resources/documents/unknown_fragment.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - ...friend -} diff --git a/ballerina-tests/tests/resources/documents/unknown_inline_fragment.graphql b/ballerina-tests/tests/resources/documents/unknown_inline_fragment.graphql deleted file mode 100644 index 95e8b7a0c..000000000 --- a/ballerina-tests/tests/resources/documents/unknown_inline_fragment.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query { - ...on on { - name - } -} diff --git a/ballerina-tests/tests/resources/documents/unknown_nested_fragments.graphql b/ballerina-tests/tests/resources/documents/unknown_nested_fragments.graphql deleted file mode 100644 index 114812f9a..000000000 --- a/ballerina-tests/tests/resources/documents/unknown_nested_fragments.graphql +++ /dev/null @@ -1,16 +0,0 @@ -query { - ...data -} - -fragment data on Query { - students { - ...details - } -} - -fragment details on Student { - courses { - name - ...fail - } -} diff --git a/ballerina-tests/tests/resources/documents/unused_fragment.graphql b/ballerina-tests/tests/resources/documents/unused_fragment.graphql deleted file mode 100644 index 5d5f58d27..000000000 --- a/ballerina-tests/tests/resources/documents/unused_fragment.graphql +++ /dev/null @@ -1,11 +0,0 @@ -query { - profile { - name { - first - } - } -} - -fragment fullNameFragment on Name { - first -} diff --git a/ballerina-tests/tests/resources/documents/valid_complexity_query.graphql b/ballerina-tests/tests/resources/documents/valid_complexity_query.graphql deleted file mode 100644 index e22ad7c13..000000000 --- a/ballerina-tests/tests/resources/documents/valid_complexity_query.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query SimpleQuery { - device(id: 2) { - brand - model - ... on Phone { - os - } - } -} diff --git a/ballerina-tests/tests/resources/documents/variables_inside_list_value.graphql b/ballerina-tests/tests/resources/documents/variables_inside_list_value.graphql deleted file mode 100644 index b7d5a9f2f..000000000 --- a/ballerina-tests/tests/resources/documents/variables_inside_list_value.graphql +++ /dev/null @@ -1,5 +0,0 @@ -query ($name1: String = "Michael", $name2: String!){ - getSuggestions(tvSeries: [{ name: $name1, episodes: [{title:"ep1", newCharacters:["Sherlock", $name1]}, {title:"ep2", newCharacters:[$name1, $name2]}]}]) { - movieName - } -} diff --git a/ballerina-tests/tests/resources/documents/variables_with_default_values.graphql b/ballerina-tests/tests/resources/documents/variables_with_default_values.graphql deleted file mode 100644 index 46d9ba2f0..000000000 --- a/ballerina-tests/tests/resources/documents/variables_with_default_values.graphql +++ /dev/null @@ -1,15 +0,0 @@ -query getData($profileId:Int = 1){ - ...data -} - -fragment data on Query { - profile(id:$profileId) { - ...people - } -} - -fragment people on Person { - address { - city - } -} diff --git a/ballerina-tests/tests/resources/documents/variables_with_multiple_operations.graphql b/ballerina-tests/tests/resources/documents/variables_with_multiple_operations.graphql deleted file mode 100644 index de2550069..000000000 --- a/ballerina-tests/tests/resources/documents/variables_with_multiple_operations.graphql +++ /dev/null @@ -1,13 +0,0 @@ -query GetProfile($id: Int!) { - profile(id: $id) { - name - age - } -} - -query GetBook($author: Author!) { - profile(author: $author) { - name - age - } -} diff --git a/ballerina-tests/tests/resources/documents/variables_with_nested_map.graphql b/ballerina-tests/tests/resources/documents/variables_with_nested_map.graphql deleted file mode 100644 index bde068a75..000000000 --- a/ballerina-tests/tests/resources/documents/variables_with_nested_map.graphql +++ /dev/null @@ -1,9 +0,0 @@ -query ($workerKey:String, $contractKey:String ) { - company { - workers(key:$workerKey) { - contacts(key:$contractKey) { - number - } - } - } -} diff --git a/ballerina-tests/tests/resources/documents/variables_with_query_and_mutation.graphql b/ballerina-tests/tests/resources/documents/variables_with_query_and_mutation.graphql deleted file mode 100644 index 4a77ee4f0..000000000 --- a/ballerina-tests/tests/resources/documents/variables_with_query_and_mutation.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query Greeting($name: String!) { - greeting(name: $name) -} - -mutation Shape($name: String!, $edges: Int!) { - addShape(name: $name, edges:$edges) { - name - edges - } -} diff --git a/ballerina-tests/tests/resources/expected_results/alias.json b/ballerina-tests/tests/resources/expected_results/alias.json deleted file mode 100644 index 701c33a11..000000000 --- a/ballerina-tests/tests/resources/expected_results/alias.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "sherlock": { - "name": { - "first": "Sherlock" - }, - "address": { - "city": "London" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/alias_on_error_path.json b/ballerina-tests/tests/resources/expected_results/alias_on_error_path.json deleted file mode 100644 index 99b381038..000000000 --- a/ballerina-tests/tests/resources/expected_results/alias_on_error_path.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "errors": [{ - "message": "No surname found", - "locations": [{ - "line": 4, - "column": 13 - }], - "path": [ - "user", - "name_fields", - "username" - ] - }], - "data": null -} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/expected_results/alias_on_hierarchical_resources.json b/ballerina-tests/tests/resources/expected_results/alias_on_hierarchical_resources.json deleted file mode 100644 index 1e18d4e62..000000000 --- a/ballerina-tests/tests/resources/expected_results/alias_on_hierarchical_resources.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "sherlock": { - "address": { - "hometown": "London" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/alias_on_service_objects_union.json b/ballerina-tests/tests/resources/expected_results/alias_on_service_objects_union.json deleted file mode 100644 index 6ddc7530d..000000000 --- a/ballerina-tests/tests/resources/expected_results/alias_on_service_objects_union.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "jesse": { - "characterName": "Jesse Pinkman" - }, - "walt": { - "ssn": 737 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/alias_with_invalid_field_name.json b/ballerina-tests/tests/resources/expected_results/alias_with_invalid_field_name.json deleted file mode 100644 index e951fff2f..000000000 --- a/ballerina-tests/tests/resources/expected_results/alias_with_invalid_field_name.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"firstName\" on type \"Person\".", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/arrays_with_errors_in_record_field.json b/ballerina-tests/tests/resources/expected_results/arrays_with_errors_in_record_field.json deleted file mode 100644 index b1a64d3fe..000000000 --- a/ballerina-tests/tests/resources/expected_results/arrays_with_errors_in_record_field.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "errors": [ - { - "message": "Undefined task!", - "locations": [ - { - "line": 5, - "column": 13 - } - ], - "path": [ - "project", - "tasks", - "subTasks", - 1 - ] - } - ], - "data": { - "project": { - "name": "Ballerina", - "tasks": { - "subTasks": null - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json b/ballerina-tests/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json deleted file mode 100644 index f88a23419..000000000 --- a/ballerina-tests/tests/resources/expected_results/attach_service_with_mutation_to_http2_based_listener.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "setName": { - "name": "Heisenberg" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json b/ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json deleted file mode 100644 index f08d89661..000000000 --- a/ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http1_based_listener.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "person": { - "age": 50 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json b/ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json deleted file mode 100644 index f08d89661..000000000 --- a/ballerina-tests/tests/resources/expected_results/attach_service_with_query_to_http2_based_listener.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "person": { - "age": 50 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json b/ballerina-tests/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json deleted file mode 100644 index f88a23419..000000000 --- a/ballerina-tests/tests/resources/expected_results/attch_service_with_mutation_to_http1_based_listener.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "setName": { - "name": "Heisenberg" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/ballerina_record_as_graphql_object.json b/ballerina-tests/tests/resources/expected_results/ballerina_record_as_graphql_object.json deleted file mode 100644 index 36301a40c..000000000 --- a/ballerina-tests/tests/resources/expected_results/ballerina_record_as_graphql_object.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "detective": { - "name": "Sherlock Holmes", - "address": { - "street": "Baker Street" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/block_strings.json b/ballerina-tests/tests/resources/expected_results/block_strings.json deleted file mode 100644 index 04a615de9..000000000 --- a/ballerina-tests/tests/resources/expected_results/block_strings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "sendEmail": "Hello,\n World!,\n\nYours,\n GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/block_strings_with_double_quotes.json b/ballerina-tests/tests/resources/expected_results/block_strings_with_double_quotes.json deleted file mode 100644 index e7376e659..000000000 --- a/ballerina-tests/tests/resources/expected_results/block_strings_with_double_quotes.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "sendEmail": "Hello,\n \"\"World\"\"!,\n\nYours,\n GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/block_strings_with_escaped_character.json b/ballerina-tests/tests/resources/expected_results/block_strings_with_escaped_character.json deleted file mode 100644 index e3f106252..000000000 --- a/ballerina-tests/tests/resources/expected_results/block_strings_with_escaped_character.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "sendEmail": "Hello,\n World!,\n\"\"\"\n Yours,\nGraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/block_strings_with_variable_default_value.json b/ballerina-tests/tests/resources/expected_results/block_strings_with_variable_default_value.json deleted file mode 100644 index 06b949eb4..000000000 --- a/ballerina-tests/tests/resources/expected_results/block_strings_with_variable_default_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "sendEmail": "Hello,\n GraphQL!," - } -} diff --git a/ballerina-tests/tests/resources/expected_results/coerce_decimal_to_float.json b/ballerina-tests/tests/resources/expected_results/coerce_decimal_to_float.json deleted file mode 100644 index 8fe4f1946..000000000 --- a/ballerina-tests/tests/resources/expected_results/coerce_decimal_to_float.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weightInPounds": 124.362 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/coerce_int_input_to_float.json b/ballerina-tests/tests/resources/expected_results/coerce_int_input_to_float.json deleted file mode 100644 index 789529f85..000000000 --- a/ballerina-tests/tests/resources/expected_results/coerce_int_input_to_float.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weightInPounds": 2.205 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal.json b/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal.json deleted file mode 100644 index 7659addc2..000000000 --- a/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 1.0 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json b/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json deleted file mode 100644 index 97f007780..000000000 --- a/ballerina-tests/tests/resources/expected_results/coerce_int_to_decimal_with_default_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 5.0 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/complex_introspection_query.json b/ballerina-tests/tests/resources/expected_results/complex_introspection_query.json deleted file mode 100644 index 04190eec0..000000000 --- a/ballerina-tests/tests/resources/expected_results/complex_introspection_query.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "__Field", - "kind": "OBJECT" - }, - { - "name": "__TypeKind", - "kind": "ENUM" - }, - { - "name": "TeacherService", - "kind": "OBJECT" - }, - { - "name": "Query", - "kind": "OBJECT" - }, - { - "name": "__Schema", - "kind": "OBJECT" - }, - { - "name": "__Type", - "kind": "OBJECT" - }, - { - "name": "__EnumValue", - "kind": "OBJECT" - }, - { - "name": "__DirectiveLocation", - "kind": "ENUM" - }, - { - "name": "StudentService", - "kind": "OBJECT" - }, - { - "name": "String", - "kind": "SCALAR" - }, - { - "name": "Int", - "kind": "SCALAR" - }, - { - "name": "Vehicle", - "kind": "OBJECT" - }, - { - "name": "Weekday", - "kind": "ENUM" - }, - { - "name": "School", - "kind": "OBJECT" - }, - { - "name": "__InputValue", - "kind": "OBJECT" - }, - { - "name": "Boolean", - "kind": "SCALAR" - }, - { - "name": "__Directive", - "kind": "OBJECT" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/complex_introspection_query_with_other_fields.json b/ballerina-tests/tests/resources/expected_results/complex_introspection_query_with_other_fields.json deleted file mode 100644 index 4a6cfd27c..000000000 --- a/ballerina-tests/tests/resources/expected_results/complex_introspection_query_with_other_fields.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "__Field", - "kind": "OBJECT" - }, - { - "name": "__TypeKind", - "kind": "ENUM" - }, - { - "name": "TeacherService", - "kind": "OBJECT" - }, - { - "name": "Query", - "kind": "OBJECT" - }, - { - "name": "__Schema", - "kind": "OBJECT" - }, - { - "name": "__Type", - "kind": "OBJECT" - }, - { - "name": "__EnumValue", - "kind": "OBJECT" - }, - { - "name": "__DirectiveLocation", - "kind": "ENUM" - }, - { - "name": "StudentService", - "kind": "OBJECT" - }, - { - "name": "String", - "kind": "SCALAR" - }, - { - "name": "Int", - "kind": "SCALAR" - }, - { - "name": "Vehicle", - "kind": "OBJECT" - }, - { - "name": "Weekday", - "kind": "ENUM" - }, - { - "name": "School", - "kind": "OBJECT" - }, - { - "name": "__InputValue", - "kind": "OBJECT" - }, - { - "name": "Boolean", - "kind": "SCALAR" - }, - { - "name": "__Directive", - "kind": "OBJECT" - } - ] - }, - "allVehicles": [ - { - "name": "Benz" - }, - { - "name": "BMW" - }, - { - "name": "Ford" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/complex_service.json b/ballerina-tests/tests/resources/expected_results/complex_service.json deleted file mode 100644 index 2d9bbc1d2..000000000 --- a/ballerina-tests/tests/resources/expected_results/complex_service.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock", - "last": "Holmes" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/complexity_with_mutation.json b/ballerina-tests/tests/resources/expected_results/complexity_with_mutation.json deleted file mode 100644 index d118f44c2..000000000 --- a/ballerina-tests/tests/resources/expected_results/complexity_with_mutation.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "The operation exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 29", - "locations": [ - { - "line": 1, - "column": 1 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/complexity_with_union_types.json b/ballerina-tests/tests/resources/expected_results/complexity_with_union_types.json deleted file mode 100644 index d118f44c2..000000000 --- a/ballerina-tests/tests/resources/expected_results/complexity_with_union_types.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "The operation exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 29", - "locations": [ - { - "line": 1, - "column": 1 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints.json b/ballerina-tests/tests/resources/expected_results/constraints.json deleted file mode 100644 index d47cd3d7b..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Input validation failed in the field \"movie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "movie" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints_configuration.json b/ballerina-tests/tests/resources/expected_results/constraints_configuration.json deleted file mode 100644 index 7e97ec10f..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_configuration.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "movie": "Interstellar" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints_with_intersection_types.json b/ballerina-tests/tests/resources/expected_results/constraints_with_intersection_types.json deleted file mode 100644 index 58dcf48ee..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_with_intersection_types.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Input validation failed in the field \"movies\": Validation failed for '$[0].downloads:minValue','$[0].imdb:minValue','$[0].name:minLength','$[0].reviews:length','$[1].imdb:minValue','$[1].name:maxLength','$[2].downloads:minValue','$[2].name:maxLength','$[2].reviews:length' constraint(s).", - "locations": [ - { - "line": 14, - "column": 5 - } - ], - "path": [ - "movies" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints_with_list_type_inputs.json b/ballerina-tests/tests/resources/expected_results/constraints_with_list_type_inputs.json deleted file mode 100644 index 9e2640c3d..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_with_list_type_inputs.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Input validation failed in the field \"reviewStars\": Validation failed for '$[0].stars:maxValueExclusive','$[1].comments:maxLength','$[1].stars:maxValueExclusive' constraint(s).", - "locations": [ - { - "line": 33, - "column": 5 - } - ], - "path": [ - "reviewStars" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints_with_mutation.json b/ballerina-tests/tests/resources/expected_results/constraints_with_mutation.json deleted file mode 100644 index 464dc2f50..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_with_mutation.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Input validation failed in the field \"addMovie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", - "locations": [ - { - "line": 8, - "column": 5 - } - ], - "path": [ - "addMovie" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints_with_subscription.json b/ballerina-tests/tests/resources/expected_results/constraints_with_subscription.json deleted file mode 100644 index efe86d758..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_with_subscription.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "message": "Input validation failed in the field \"movie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", - "locations": [ - { - "line": 24, - "column": 5 - } - ], - "path": [ - "movie" - ] - } -] diff --git a/ballerina-tests/tests/resources/expected_results/constraints_with_variables_1.json b/ballerina-tests/tests/resources/expected_results/constraints_with_variables_1.json deleted file mode 100644 index e3b8b892a..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_with_variables_1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Input validation failed in the field \"movie\": Validation failed for '$.downloads:minValue','$.imdb:minValue','$.name:maxLength','$.reviews:length' constraint(s).", - "locations": [ - { - "line": 42, - "column": 5 - } - ], - "path": [ - "movie" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/constraints_with_variables_2.json b/ballerina-tests/tests/resources/expected_results/constraints_with_variables_2.json deleted file mode 100644 index 891b39d0d..000000000 --- a/ballerina-tests/tests/resources/expected_results/constraints_with_variables_2.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Input validation failed in the field \"movies\": Validation failed for '$[0].downloads:minValue','$[0].imdb:minValue','$[0].name:minLength','$[0].reviews:length','$[1].name:maxLength','$[2].downloads:minValue' constraint(s).", - "locations": [ - { - "line": 46, - "column": 5 - } - ], - "path": [ - "movies" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json b/ballerina-tests/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json deleted file mode 100644 index 0307afcab..000000000 --- a/ballerina-tests/tests/resources/expected_results/dataloader_with_different_alias_for_same_field.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "data": { - "firstThree": [ - { - "name": "Author 1", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - { - "name": "Author 2", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - }, - { - "name": "Author 3", - "books": [ - { - "id": 6, - "title": "Book 6" - }, - { - "id": 7, - "title": "Book 7" - } - ] - } - ], - "lastTwo": [ - { - "name": "Author 4", - "books": [ - { - "id": 8, - "title": "Book 8" - } - ] - }, - { - "name": "Author 5", - "books": [ - { - "id": 9, - "title": "Book 9" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/dataloader_with_interceptor.json b/ballerina-tests/tests/resources/expected_results/dataloader_with_interceptor.json deleted file mode 100644 index 5a65121dc..000000000 --- a/ballerina-tests/tests/resources/expected_results/dataloader_with_interceptor.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "data": { - "one": [ - { - "name": "Author 1", - "books": [ - { - "title": "Book 1" - } - ] - } - ], - "four": [ - { - "name": "Author 4", - "books": [ - { - "title": "Book 8" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/dataloader_with_mutation.json b/ballerina-tests/tests/resources/expected_results/dataloader_with_mutation.json deleted file mode 100644 index dc842c15c..000000000 --- a/ballerina-tests/tests/resources/expected_results/dataloader_with_mutation.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "data": { - "sabthar": { - "name": "Sabthar", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - "mahroof": { - "name": "Mahroof", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/dataloader_with_query.json b/ballerina-tests/tests/resources/expected_results/dataloader_with_query.json deleted file mode 100644 index 4735acf37..000000000 --- a/ballerina-tests/tests/resources/expected_results/dataloader_with_query.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "data": { - "authors": [ - { - "name": "Author 1", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - { - "name": "Author 2", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - }, - { - "name": "Author 3", - "books": [ - { - "id": 6, - "title": "Book 6" - }, - { - "id": 7, - "title": "Book 7" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_default_value.json b/ballerina-tests/tests/resources/expected_results/decimal_type_default_value.json deleted file mode 100644 index 6bd9d2955..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_default_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 2.3332414141451451411231341451 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_input.json b/ballerina-tests/tests/resources/expected_results/decimal_type_input.json deleted file mode 100644 index a4e806aae..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 1.33 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_list_input.json b/ballerina-tests/tests/resources/expected_results/decimal_type_list_input.json deleted file mode 100644 index 139b52c84..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_list_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getTotalInDecimal": [6.13, 11.6, 20.0] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_list_with_default_input.json b/ballerina-tests/tests/resources/expected_results/decimal_type_list_with_default_input.json deleted file mode 100644 index 914e47af9..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_list_with_default_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getTotalInDecimal": [6.1886662, 11.63535, 20.0] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_list_with_variable_input.json b/ballerina-tests/tests/resources/expected_results/decimal_type_list_with_variable_input.json deleted file mode 100644 index 914e47af9..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_list_with_variable_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getTotalInDecimal": [6.1886662, 11.63535, 20.0] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_variable_input.json b/ballerina-tests/tests/resources/expected_results/decimal_type_variable_input.json deleted file mode 100644 index 6bd9d2955..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_variable_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 2.3332414141451451411231341451 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object.json b/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object.json deleted file mode 100644 index 16a30fa4e..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getSubTotal": 218.5555332 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_default_value.json b/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_default_value.json deleted file mode 100644 index 16a30fa4e..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_default_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getSubTotal": 218.5555332 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_variable.json b/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_variable.json deleted file mode 100644 index 16a30fa4e..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_type_with_input_object_variable.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getSubTotal": 218.5555332 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_with_marginal_value.json b/ballerina-tests/tests/resources/expected_results/decimal_with_marginal_value.json deleted file mode 100644 index 5513e10ea..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_with_marginal_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 1.797693134862314E308 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_with_negative_infinity.json b/ballerina-tests/tests/resources/expected_results/decimal_with_negative_infinity.json deleted file mode 100644 index bb7cf65ab..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_with_negative_infinity.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Decimal cannot represent non Decimal value: -Infinity", - "locations": [ - { - "line": 2, - "column": 34 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_with_negative_zero.json b/ballerina-tests/tests/resources/expected_results/decimal_with_negative_zero.json deleted file mode 100644 index 015c2c260..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_with_negative_zero.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "convertDecimalToFloat": 0.0 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/decimal_with_positive_infinity.json b/ballerina-tests/tests/resources/expected_results/decimal_with_positive_infinity.json deleted file mode 100644 index b29313ba9..000000000 --- a/ballerina-tests/tests/resources/expected_results/decimal_with_positive_infinity.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Decimal cannot represent non Decimal value: Infinity", - "locations": [ - { - "line": 2, - "column": 34 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/default_values_in_input_object_fields.json b/ballerina-tests/tests/resources/expected_results/default_values_in_input_object_fields.json deleted file mode 100644 index 2f2eb139e..000000000 --- a/ballerina-tests/tests/resources/expected_results/default_values_in_input_object_fields.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "name": "Sam" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering.json b/ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering.json deleted file mode 100644 index 8addf013b..000000000 --- a/ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "fields": [ - { - "name": "greeting", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "profile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [] - } - } - }, - { - "name": "school", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "School", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - } - ] - }, - "mutationType": { - "fields": [ - { - "name": "addProfile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [] - } - } - }, - { - "name": "addInstrument", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "Instrument", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - } - ] - }, - "subscriptionType": { - "fields": [ - { - "name": "instruments", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - } - ] - } - }, - "__type": { - "enumValues": [ - { - "name": "PERCUSSION", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "KEYBOARD", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "WOODWIND", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STRINGS", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json b/ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json deleted file mode 100644 index 8addf013b..000000000 --- a/ballerina-tests/tests/resources/expected_results/deprecated_fields_filtering_with_variables.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "fields": [ - { - "name": "greeting", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "profile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [] - } - } - }, - { - "name": "school", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "School", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - } - ] - }, - "mutationType": { - "fields": [ - { - "name": "addProfile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [] - } - } - }, - { - "name": "addInstrument", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "Instrument", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - } - ] - }, - "subscriptionType": { - "fields": [ - { - "name": "instruments", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - } - ] - } - }, - "__type": { - "enumValues": [ - { - "name": "PERCUSSION", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "KEYBOARD", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "WOODWIND", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STRINGS", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection.json b/ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection.json deleted file mode 100644 index 23b1b7b6c..000000000 --- a/ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "fields": [ - { - "name": "hello", - "isDeprecated": true, - "deprecationReason": "Use the `greeting` field instead of this field.", - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "greeting", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "profile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [ - { - "name": "name", - "isDeprecated": true, - "deprecationReason": "Name field is deprecated" - }, - { - "name": "age", - "isDeprecated": true, - "deprecationReason": "Age field is deprecated" - }, - { - "name": "address", - "isDeprecated": true, - "deprecationReason": "Address field is deprecated" - } - ] - } - } - }, - { - "name": "school", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "School", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "openingDays", - "isDeprecated": true, - "deprecationReason": "School is now online." - } - ] - } - } - } - ] - }, - "mutationType": { - "fields": [ - { - "name": "addProfile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [ - { - "name": "name", - "isDeprecated": true, - "deprecationReason": "Name field is deprecated" - }, - { - "name": "age", - "isDeprecated": true, - "deprecationReason": "Age field is deprecated" - }, - { - "name": "address", - "isDeprecated": true, - "deprecationReason": "Address field is deprecated" - } - ] - } - } - }, - { - "name": "newInstrument", - "isDeprecated": true, - "deprecationReason": "Use the `addInstrument` field instead of this.", - "type": { - "ofType": { - "name": "Instrument", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - }, - { - "name": "addInstrument", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "Instrument", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - } - ] - }, - "subscriptionType": { - "fields": [ - { - "name": "newInstruments", - "isDeprecated": true, - "deprecationReason": "Use the `instruments` field instead of this.", - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "instruments", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - } - ] - } - }, - "t1": { - "enumValues": [ - { - "name": "PERCUSSION", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BRASS", - "isDeprecated": true, - "deprecationReason": "Not used in this band" - }, - { - "name": "KEYBOARD", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "WOODWIND", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STRINGS", - "isDeprecated": false, - "deprecationReason": null - } - ] - }, - "t2": { - "fields": [ - { - "name": "number", - "isDeprecated": true, - "deprecationReason": "Number field is deprecated", - "type": { - "ofType": { - "name": "Int", - "fields": null - } - } - }, - { - "name": "street", - "isDeprecated": true, - "deprecationReason": "Street field is deprecated", - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "city", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json b/ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json deleted file mode 100644 index d4a7a36f3..000000000 --- a/ballerina-tests/tests/resources/expected_results/deprecated_fields_introspection_with_variables.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "fields": [ - { - "name": "hello", - "isDeprecated": true, - "deprecationReason": "Use the `greeting` field instead of this field.", - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "greeting", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "profile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [ - { - "name": "name", - "isDeprecated": true, - "deprecationReason": "Name field is deprecated" - }, - { - "name": "age", - "isDeprecated": true, - "deprecationReason": "Age field is deprecated" - }, - { - "name": "address", - "isDeprecated": true, - "deprecationReason": "Address field is deprecated" - } - ] - } - } - }, - { - "name": "school", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "School", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "openingDays", - "isDeprecated": true, - "deprecationReason": "School is now online." - } - ] - } - } - } - ] - }, - "mutationType": { - "fields": [ - { - "name": "addProfile", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "DeprecatedProfile", - "fields": [ - { - "name": "name", - "isDeprecated": true, - "deprecationReason": "Name field is deprecated" - }, - { - "name": "age", - "isDeprecated": true, - "deprecationReason": "Age field is deprecated" - }, - { - "name": "address", - "isDeprecated": true, - "deprecationReason": "Address field is deprecated" - } - ] - } - } - }, - { - "name": "newInstrument", - "isDeprecated": true, - "deprecationReason": "Use the `addInstrument` field instead of this.", - "type": { - "ofType": { - "name": "Instrument", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - }, - { - "name": "addInstrument", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "Instrument", - "fields": [ - { - "name": "name", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } - } - ] - }, - "subscriptionType": { - "fields": [ - { - "name": "newInstruments", - "isDeprecated": true, - "deprecationReason": "Use the `instruments` field instead of this.", - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - }, - { - "name": "instruments", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "ofType": { - "name": "String", - "fields": null - } - } - } - ] - } - }, - "__type": { - "enumValues": [ - { - "name": "PERCUSSION", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BRASS", - "isDeprecated": true, - "deprecationReason": "Not used in this band" - }, - { - "name": "KEYBOARD", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "WOODWIND", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STRINGS", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/directive_locations.json b/ballerina-tests/tests/resources/expected_results/directive_locations.json deleted file mode 100644 index 76be9f884..000000000 --- a/ballerina-tests/tests/resources/expected_results/directive_locations.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "data": { - "__schema": { - "directives": [ - { - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ] - }, - { - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ] - }, - { - "locations": [ - "FIELD_DEFINITION", - "ENUM_VALUE" - ] - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/directives.json b/ballerina-tests/tests/resources/expected_results/directives.json deleted file mode 100644 index d3bf8e5ee..000000000 --- a/ballerina-tests/tests/resources/expected_results/directives.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "last": "Holmes" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/directives_skip_all_selections.json b/ballerina-tests/tests/resources/expected_results/directives_skip_all_selections.json deleted file mode 100644 index bdb4f5bb3..000000000 --- a/ballerina-tests/tests/resources/expected_results/directives_skip_all_selections.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": {} -} diff --git a/ballerina-tests/tests/resources/expected_results/directives_with_duplicate_fields.json b/ballerina-tests/tests/resources/expected_results/directives_with_duplicate_fields.json deleted file mode 100644 index 7af17d92a..000000000 --- a/ballerina-tests/tests/resources/expected_results/directives_with_duplicate_fields.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "profile": { - "name": "Walter White", - "address": { - "number": "308" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/directives_with_service_returning_objects_array.json b/ballerina-tests/tests/resources/expected_results/directives_with_service_returning_objects_array.json deleted file mode 100644 index f7594f45d..000000000 --- a/ballerina-tests/tests/resources/expected_results/directives_with_service_returning_objects_array.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "searchVehicles": [ - {}, - {}, - {} - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/directives_with_variables_and_fragments.json b/ballerina-tests/tests/resources/expected_results/directives_with_variables_and_fragments.json deleted file mode 100644 index 886834f18..000000000 --- a/ballerina-tests/tests/resources/expected_results/directives_with_variables_and_fragments.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "profile": { - "name": "Walter White", - "address": { - "street": "Negra Arroyo Lane" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/documentation.json b/ballerina-tests/tests/resources/expected_results/documentation.json deleted file mode 100644 index 92f21bc4b..000000000 --- a/ballerina-tests/tests/resources/expected_results/documentation.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "data": { - "__schema": { - "description": "GraphQL service with documentation.", - "queryType": { - "fields": [ - { - "name": "greeting", - "description": "Greets a person with provided name.\n", - "type": { - "name": null, - "description": null, - "fields": null, - "ofType": { - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null - } - }, - "args": [ - { - "name": "name", - "description": "The name of the person" - } - ] - }, - { - "name": "instrument", - "description": "Returns a predefined instrument.\n", - "type": { - "name": null, - "description": null, - "fields": null, - "ofType": { - "name": "Instrument", - "description": "Represents an instrument\n", - "fields": [ - { - "name": "name", - "description": "Name of the instrument" - }, - { - "name": "type", - "description": "The type of the musical instrument" - } - ] - } - }, - "args": [] - } - ] - }, - "mutationType": { - "fields": [ - { - "name": "addShape", - "description": "Updates a shape in the database.\n", - "type": { - "name": null, - "description": null, - "fields": null, - "ofType": { - "name": "Shape", - "description": "Represents a shape\n", - "fields": [ - { - "name": "name", - "description": "Name of the shape" - }, - { - "name": "edges", - "description": "Number of edges in the shape" - } - ] - } - }, - "args": [ - { - "name": "name", - "description": "Name of the new shape" - }, - { - "name": "edges", - "description": "Number of edges of the new shape" - } - ] - } - ] - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json deleted file mode 100644 index b531455cd..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"isHoliday\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 19, - "column": 5 - }, - { - "line": 20, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json deleted file mode 100644 index 8b20b1aee..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_2.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"isHoliday\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 24, - "column": 5 - }, - { - "line": 26, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json deleted file mode 100644 index 93defe5c6..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_enum_args_3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"isHoliday\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 30, - "column": 5 - }, - { - "line": 31, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json deleted file mode 100644 index dd758af7d..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 35, - "column": 5 - }, - { - "line": 41, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json deleted file mode 100644 index c50937591..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_2.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 47, - "column": 5 - }, - { - "line": 53, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json deleted file mode 100644 index 72c718bb3..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 59, - "column": 5 - }, - { - "line": 65, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json deleted file mode 100644 index 125f5b3c3..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_input_object_args_4.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"book\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 71, - "column": 5 - }, - { - "line": 74, - "column": 5 - } - ] - }, - { - "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 77, - "column": 5 - }, - { - "line": 79, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_1.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_1.json deleted file mode 100644 index 897a5e925..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_1.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"concat\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 83, - "column": 5 - }, - { - "line": 85, - "column": 5 - }, - { - "line": 86, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_2.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_2.json deleted file mode 100644 index bf00a7830..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"concat\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 90, - "column": 5 - }, - { - "line": 91, - "column": 5 - } - ] - }, - { - "message": "Field(s) \"getTotal\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 92, - "column": 5 - }, - { - "line": 93, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_3.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_3.json deleted file mode 100644 index 0be753f32..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_list_args_3.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"getTotal\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 97, - "column": 5 - }, - { - "line": 99, - "column": 5 - }, - { - "line": 100, - "column": 5 - }, - { - "line": 101, - "column": 5 - } - ] - }, - { - "message": "Field(s) \"total\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 102, - "column": 5 - }, - { - "line": 103, - "column": 5 - }, - { - "line": 104, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_record_types.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_record_types.json deleted file mode 100644 index 41a92721e..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_record_types.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock", - "last": "Holmes" - }, - "address": { - "city": "London", - "street": "Baker Street" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json deleted file mode 100644 index 8eaf7ebf5..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"greet\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 2, - "column": 5 - }, - { - "line": 3, - "column": 5 - } - ] - }, - { - "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 4, - "column": 5 - }, - { - "line": 5, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json deleted file mode 100644 index 40ab5b7dc..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_2.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 9, - "column": 5 - }, - { - "line": 10, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json b/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json deleted file mode 100644 index 81cdc7916..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_fields_with_scalar_args_3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Field(s) \"name\" conflict because they have differing arguments. Use different aliases on the fields to fetch both if this was intentional.", - "locations": [ - { - "line": 14, - "column": 5 - }, - { - "line": 15, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_inline_fragments.json b/ballerina-tests/tests/resources/expected_results/duplicate_inline_fragments.json deleted file mode 100644 index d2d79352f..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_inline_fragments.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "data": { - "people": [ - { - "address": { - "street": "Baker Street", - "number": "221/B", - "city": "London" - } - }, - { - "address": { - "street": "Negra Arroyo Lane", - "number": "308", - "city": "Albuquerque" - } - }, - { - "address": { - "street": "Unknown", - "number": "Uknown", - "city": "Hogwarts" - } - } - ], - "students": [ - { - "name": "John Doe" - }, - { - "name": "Jane Doe" - }, - { - "name": "Jonny Doe" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_input_variables.json b/ballerina-tests/tests/resources/expected_results/duplicate_input_variables.json deleted file mode 100644 index dc099ca3e..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_input_variables.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "There can be only one variable named \"$userName\"", - "locations": [ - { - "line": 1, - "column": 21 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_interceptors.json b/ballerina-tests/tests/resources/expected_results/duplicate_interceptors.json deleted file mode 100644 index 64cd33855..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_interceptors.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data":{ - "age": 29 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json b/ballerina-tests/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json deleted file mode 100644 index 35bdbab1f..000000000 --- a/ballerina-tests/tests/resources/expected_results/duplicate_variables_with_multiple_operations.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "profile": { - "address": { - "city": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/empty_block_string.json b/ballerina-tests/tests/resources/expected_results/empty_block_string.json deleted file mode 100644 index 2c477101a..000000000 --- a/ballerina-tests/tests/resources/expected_results/empty_block_string.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data":{ - "sendEmail":"" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects.json b/ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects.json deleted file mode 100644 index c716cdd01..000000000 --- a/ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "data": { - "getMovie": [ - { - "movieName": "Harry Potter and the Sorcerer's Stone", - "director": "Chris Columbus" - }, - { - "movieName": "Sherlock Holmes", - "director": "Dexter Fletcher" - }, - { - "movieName": "El Camino", - "director": "Vince Gilligan" - }, - { - "movieName": "Escape Plan", - "director": "Mikael Hafstrom" - }, - { - "movieName": "Papillon", - "director": "Franklin Schaffner" - }, - { - "movieName": "The Fugitive", - "director": "Andrew Davis" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json b/ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json deleted file mode 100644 index c716cdd01..000000000 --- a/ballerina-tests/tests/resources/expected_results/empty_list_type_within_input_objects_with_variables.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "data": { - "getMovie": [ - { - "movieName": "Harry Potter and the Sorcerer's Stone", - "director": "Chris Columbus" - }, - { - "movieName": "Sherlock Holmes", - "director": "Dexter Fletcher" - }, - { - "movieName": "El Camino", - "director": "Vince Gilligan" - }, - { - "movieName": "Escape Plan", - "director": "Mikael Hafstrom" - }, - { - "movieName": "Papillon", - "director": "Franklin Schaffner" - }, - { - "movieName": "The Fugitive", - "director": "Andrew Davis" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/empty_string.json b/ballerina-tests/tests/resources/expected_results/empty_string.json deleted file mode 100644 index 2c477101a..000000000 --- a/ballerina-tests/tests/resources/expected_results/empty_string.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data":{ - "sendEmail":"" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum.json b/ballerina-tests/tests/resources/expected_results/enum.json deleted file mode 100644 index 4befeef0c..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "time": { - "weekday": "MONDAY" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_input_parameter.json b/ballerina-tests/tests/resources/expected_results/enum_input_parameter.json deleted file mode 100644 index d12cf6dcc..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_input_parameter.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_input_parameter_as_string.json b/ballerina-tests/tests/resources/expected_results/enum_input_parameter_as_string.json deleted file mode 100644 index caebf29a7..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_input_parameter_as_string.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Enum \"Weekday\" cannot represent non-enum value: \"SUNDAY\"", - "locations": [ - { - "line": 2, - "column": 24 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_inside_record.json b/ballerina-tests/tests/resources/expected_results/enum_inside_record.json deleted file mode 100644 index f0d61ec50..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_inside_record.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weekday": "WEDNESDAY" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_introspection.json b/ballerina-tests/tests/resources/expected_results/enum_introspection.json deleted file mode 100644 index d58dfe7b4..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_introspection.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "Company", - "enumValues": null - }, - { - "name": "Task", - "enumValues": null - }, - { - "name": "__Field", - "enumValues": null - }, - { - "name": "__TypeKind", - "enumValues": [ - { - "name": "SCALAR" - }, - { - "name": "OBJECT" - }, - { - "name": "INTERFACE" - }, - { - "name": "UNION" - }, - { - "name": "ENUM" - }, - { - "name": "INPUT_OBJECT" - }, - { - "name": "LIST" - }, - { - "name": "NON_NULL" - } - ] - }, - { - "name": "Query", - "enumValues": null - }, - { - "name": "__Schema", - "enumValues": null - }, - { - "name": "__Type", - "enumValues": null - }, - { - "name": "__EnumValue", - "enumValues": null - }, - { - "name": "__DirectiveLocation", - "enumValues": [ - { - "name": "QUERY" - }, - { - "name": "MUTATION" - }, - { - "name": "SUBSCRIPTION" - }, - { - "name": "FIELD" - }, - { - "name": "FRAGMENT_DEFINITION" - }, - { - "name": "FRAGMENT_SPREAD" - }, - { - "name": "INLINE_FRAGMENT" - }, - { - "name": "VARIABLE_DEFINITION" - }, - { - "name": "SCHEMA" - }, - { - "name": "SCALAR" - }, - { - "name": "OBJECT" - }, - { - "name": "FIELD_DEFINITION" - }, - { - "name": "ARGUMENT_DEFINITION" - }, - { - "name": "INTERFACE" - }, - { - "name": "UNION" - }, - { - "name": "ENUM" - }, - { - "name": "ENUM_VALUE" - }, - { - "name": "INPUT_OBJECT" - }, - { - "name": "INPUT_FIELD_DEFINITION" - } - ] - }, - { - "name": "Time", - "enumValues": null - }, - { - "name": "String", - "enumValues": null - }, - { - "name": "Int", - "enumValues": null - }, - { - "name": "Contact", - "enumValues": null - }, - { - "name": "Weekday", - "enumValues": [ - { - "name": "SATURDAY" - }, - { - "name": "FRIDAY" - }, - { - "name": "THURSDAY" - }, - { - "name": "WEDNESDAY" - }, - { - "name": "TUESDAY" - }, - { - "name": "MONDAY" - }, - { - "name": "SUNDAY" - } - ] - }, - { - "name": "Month", - "enumValues": [ - { - "name": "DECEMBER" - }, - { - "name": "NOVEMBER" - }, - { - "name": "OCTOBER" - }, - { - "name": "SEPTEMBER" - }, - { - "name": "AUGUST" - }, - { - "name": "JULY" - }, - { - "name": "JUNE" - }, - { - "name": "MAY" - }, - { - "name": "APRIL" - }, - { - "name": "MARCH" - }, - { - "name": "FEBRUARY" - }, - { - "name": "JANUARY" - } - ] - }, - { - "name": "Project", - "enumValues": null - }, - { - "name": "Worker", - "enumValues": null - }, - { - "name": "__InputValue", - "enumValues": null - }, - { - "name": "Boolean", - "enumValues": null - }, - { - "name": "__Directive", - "enumValues": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_invalid_input_parameter.json b/ballerina-tests/tests/resources/expected_results/enum_invalid_input_parameter.json deleted file mode 100644 index b80dc163a..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_invalid_input_parameter.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Value \"FUNDAY\" does not exist in \"weekday\" enum.", - "locations": [ - { - "line": 2, - "column": 24 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_type_default_value_with_variables.json b/ballerina-tests/tests/resources/expected_results/enum_type_default_value_with_variables.json deleted file mode 100644 index d12cf6dcc..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_type_default_value_with_variables.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_type_variables.json b/ballerina-tests/tests/resources/expected_results/enum_type_variables.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_type_variables.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_value_introspection.json b/ballerina-tests/tests/resources/expected_results/enum_value_introspection.json deleted file mode 100644 index 3b94a9059..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_value_introspection.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"enumValues\" of type \"[__EnumValue!]\" must have a selection of subfields. Did you mean \"enumValues { ... }\"?", - "locations": [ - { - "line": 4, - "column": 13 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_with_union.json b/ballerina-tests/tests/resources/expected_results/enum_with_union.json deleted file mode 100644 index 776ef62f2..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_with_union.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "errors": [ - { - "message": "Invalid number", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["day"] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_with_values_assigned.json b/ballerina-tests/tests/resources/expected_results/enum_with_values_assigned.json deleted file mode 100644 index 95668bd1e..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_with_values_assigned.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "month": "Jan" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/enum_with_values_assigned_using_variables.json b/ballerina-tests/tests/resources/expected_results/enum_with_values_assigned_using_variables.json deleted file mode 100644 index 3b93ae285..000000000 --- a/ballerina-tests/tests/resources/expected_results/enum_with_values_assigned_using_variables.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "month": "May" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/errors_in_streams.json b/ballerina-tests/tests/resources/expected_results/errors_in_streams.json deleted file mode 100644 index cea4ca90a..000000000 --- a/ballerina-tests/tests/resources/expected_results/errors_in_streams.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Runtime exception", - "locations": [ - { - "line": 1, - "column": 16 - } - ], - "path": [ - "evenNumber" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/execute_same_interceptor_multiple_times.json b/ballerina-tests/tests/resources/expected_results/execute_same_interceptor_multiple_times.json deleted file mode 100644 index 64cd33855..000000000 --- a/ballerina-tests/tests/resources/expected_results/execute_same_interceptor_multiple_times.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data":{ - "age": 29 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/field_object.json b/ballerina-tests/tests/resources/expected_results/field_object.json deleted file mode 100644 index 24993a363..000000000 --- a/ballerina-tests/tests/resources/expected_results/field_object.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "person": { - "name": "Sherlock Holmes" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/field_object_parameter_order1.json b/ballerina-tests/tests/resources/expected_results/field_object_parameter_order1.json deleted file mode 100644 index 54585b933..000000000 --- a/ballerina-tests/tests/resources/expected_results/field_object_parameter_order1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "student": { - "name": "Jesse Pinkman" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/field_object_parameter_order2.json b/ballerina-tests/tests/resources/expected_results/field_object_parameter_order2.json deleted file mode 100644 index 50dfbfc18..000000000 --- a/ballerina-tests/tests/resources/expected_results/field_object_parameter_order2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "student": { - "name": "Skinny Pete", - "id": 100 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/field_object_with_multiple_args.json b/ballerina-tests/tests/resources/expected_results/field_object_with_multiple_args.json deleted file mode 100644 index 76846149f..000000000 --- a/ballerina-tests/tests/resources/expected_results/field_object_with_multiple_args.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "person": { - "name": "Walter White", - "age": 50 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/float_as_input.json b/ballerina-tests/tests/resources/expected_results/float_as_input.json deleted file mode 100644 index 8c6f2b256..000000000 --- a/ballerina-tests/tests/resources/expected_results/float_as_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weightInPounds": 2.8665000000000003 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/float_type_variable_with_default_value.json b/ballerina-tests/tests/resources/expected_results/float_type_variable_with_default_value.json deleted file mode 100644 index e1030ab06..000000000 --- a/ballerina-tests/tests/resources/expected_results/float_type_variable_with_default_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weightInPounds": 9.599247 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/fragment_on_invalid_type.json b/ballerina-tests/tests/resources/expected_results/fragment_on_invalid_type.json deleted file mode 100644 index d2cf1591f..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragment_on_invalid_type.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Fragment \"data\" cannot be spread here as objects of type \"Query\" can never be of type \"Person\".", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/fragment_with_invalid_field.json b/ballerina-tests/tests/resources/expected_results/fragment_with_invalid_field.json deleted file mode 100644 index eefcc3ed4..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragment_with_invalid_field.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"invalid\" on type \"Person\".", - "locations": [ - { - "line": 7, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json b/ballerina-tests/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json deleted file mode 100644 index b60c9fca5..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_inside_fragments_when_returning_services.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "teacher": { - "name": "Walter White" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_on_record_objects.json b/ballerina-tests/tests/resources/expected_results/fragments_on_record_objects.json deleted file mode 100644 index ef479b007..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_on_record_objects.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "people": [ - { - "name": "Sherlock Holmes" - }, - { - "name": "Walter White" - }, - { - "name": "Tom Marvolo Riddle" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_querying_service_objects.json b/ballerina-tests/tests/resources/expected_results/fragments_querying_service_objects.json deleted file mode 100644 index 910703992..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_querying_service_objects.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_with_input_variables.json b/ballerina-tests/tests/resources/expected_results/fragments_with_input_variables.json deleted file mode 100644 index 35bdbab1f..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_with_input_variables.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "profile": { - "address": { - "city": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_with_introspection.json b/ballerina-tests/tests/resources/expected_results/fragments_with_introspection.json deleted file mode 100644 index 07ad2b281..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_with_introspection.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "__Field" - }, - { - "name": "__TypeKind" - }, - { - "name": "Query" - }, - { - "name": "Address" - }, - { - "name": "__Schema" - }, - { - "name": "__Type" - }, - { - "name": "__EnumValue" - }, - { - "name": "__DirectiveLocation" - }, - { - "name": "String" - }, - { - "name": "Student" - }, - { - "name": "Int" - }, - { - "name": "Book" - }, - { - "name": "__InputValue" - }, - { - "name": "Course" - }, - { - "name": "Boolean" - }, - { - "name": "Person" - }, - { - "name": "__Directive" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_with_invalid_introspection.json b/ballerina-tests/tests/resources/expected_results/fragments_with_invalid_introspection.json deleted file mode 100644 index ce1b0d12b..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_with_invalid_introspection.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"invalid\" on type \"__Type\".", - "locations": [ - { - "line": 17, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json b/ballerina-tests/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json deleted file mode 100644 index a262e49b5..000000000 --- a/ballerina-tests/tests/resources/expected_results/fragments_with_multiple_resource_invocation.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data": { - "people": [ - { - "address": { - "city": "London" - } - }, - { - "address": { - "city": "Albuquerque" - } - }, - { - "address": { - "city": "Hogwarts" - } - } - ], - "students": [ - { - "name": "John Doe" - }, - { - "name": "Jane Doe" - }, - { - "name": "Jonny Doe" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/functions_with_input_parameter.json b/ballerina-tests/tests/resources/expected_results/functions_with_input_parameter.json deleted file mode 100644 index f26dbe44e..000000000 --- a/ballerina-tests/tests/resources/expected_results/functions_with_input_parameter.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "greet": "Hello, Thisaru" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query.json b/ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query.json deleted file mode 100644 index 9c93f7faf..000000000 --- a/ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query.json +++ /dev/null @@ -1,1483 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "name": "Query" - }, - "mutationType": null, - "subscriptionType": null, - "types": [ - { - "kind": "ENUM", - "name": "Status", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "HOLD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CLOSED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OPEN", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Query", - "description": null, - "fields": [ - { - "name": "allLifts", - "description": null, - "args": [ - { - "name": "status", - "description": null, - "type": { - "kind": "ENUM", - "name": "Status", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Lift", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "allTrails", - "description": null, - "args": [ - { - "name": "status", - "description": null, - "type": { - "kind": "ENUM", - "name": "Status", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trail", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lift", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Lift", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trail", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Trail", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "liftCount", - "description": null, - "args": [ - { - "name": "status", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Status", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trailCount", - "description": null, - "args": [ - { - "name": "status", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Status", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "search", - "description": null, - "args": [ - { - "name": "status", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Status", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "UNION", - "name": "SearchResult", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "VARIABLE_DEFINITION", - "description": "Location adjacent to a variable definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "UNION", - "name": "SearchResult", - "description": "auto-generated union type from Ballerina", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Lift", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Trail", - "ofType": null - } - ] - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Lift", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "capacity", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "night", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "elevationgain", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trailAccess", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Trail", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Trail", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "difficulty", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "groomed", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trees", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "night", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "accessByLifts", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Lift", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - } - ], - "directives": [ - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": [ - "FIELD_DEFINITION", - "ENUM_VALUE" - ], - "args": [ - { - "name": "reason", - "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ] - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json b/ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json deleted file mode 100644 index 37e75949b..000000000 --- a/ballerina-tests/tests/resources/expected_results/graphql_playground_introspection_query_with_complexity_validation.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "The operation IntrospectionQuery exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 50", - "locations": [ - { - "line": 1, - "column": 1 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json b/ballerina-tests/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json deleted file mode 100644 index 04ba24bd3..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_paths_same_type_in_multiple_paths.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths.json deleted file mode 100644 index 910703992..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_complete.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_complete.json deleted file mode 100644 index 842aea46d..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_complete.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock", - "last": "Holmes" - }, - "age": 40 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_introspection.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_introspection.json deleted file mode 100644 index 95d366312..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_introspection.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "__Field", - "fields": [ - { - "name": "name" - }, - { - "name": "description" - }, - { - "name": "args" - }, - { - "name": "type" - }, - { - "name": "isDeprecated" - }, - { - "name": "deprecationReason" - } - ] - }, - { - "name": "__TypeKind", - "fields": null - }, - { - "name": "address", - "fields": [ - { - "name": "city" - }, - { - "name": "street" - }, - { - "name": "number" - } - ] - }, - { - "name": "Query", - "fields": [ - { - "name": "profile" - } - ] - }, - { - "name": "__Schema", - "fields": [ - { - "name": "description" - }, - { - "name": "types" - }, - { - "name": "queryType" - }, - { - "name": "mutationType" - }, - { - "name": "subscriptionType" - }, - { - "name": "directives" - } - ] - }, - { - "name": "__Type", - "fields": [ - { - "name": "kind" - }, - { - "name": "name" - }, - { - "name": "description" - }, - { - "name": "fields" - }, - { - "name": "interfaces" - }, - { - "name": "possibleTypes" - }, - { - "name": "enumValues" - }, - { - "name": "inputFields" - }, - { - "name": "ofType" - } - ] - }, - { - "name": "__EnumValue", - "fields": [ - { - "name": "name" - }, - { - "name": "description" - }, - { - "name": "isDeprecated" - }, - { - "name": "deprecationReason" - } - ] - }, - { - "name": "__DirectiveLocation", - "fields": null - }, - { - "name": "profile", - "fields": [ - { - "name": "name" - }, - { - "name": "age" - }, - { - "name": "address" - } - ] - }, - { - "name": "String", - "fields": null - }, - { - "name": "Int", - "fields": null - }, - { - "name": "name", - "fields": [ - { - "name": "first" - }, - { - "name": "last" - }, - { - "name": "address" - } - ] - }, - { - "name": "__InputValue", - "fields": [ - { - "name": "name" - }, - { - "name": "description" - }, - { - "name": "type" - }, - { - "name": "defaultValue" - } - ] - }, - { - "name": "Boolean", - "fields": null - }, - { - "name": "__Directive", - "fields": [ - { - "name": "name" - }, - { - "name": "description" - }, - { - "name": "locations" - }, - { - "name": "args" - } - ] - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json deleted file mode 100644 index ebb2e6c9b..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_returning_services_with_hierarchical_resource_path.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "profile": { - "personal": { - "name": { - "first": "Sherlock" - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json deleted file mode 100644 index 2d9bbc1d2..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_fragments.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock", - "last": "Holmes" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json deleted file mode 100644 index 2d9bbc1d2..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_multiple_fields.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "profile": { - "name": { - "first": "Sherlock", - "last": "Holmes" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json deleted file mode 100644 index c8518522d..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "mountain": { - "trail": { - "getLift": { - "name": "Lift2" - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json b/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json deleted file mode 100644 index 61ec1b9e9..000000000 --- a/ballerina-tests/tests/resources/expected_results/hierarchical_resource_paths_with_same_field_repeating_2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "lift": { - "name": "Lift1" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal.json deleted file mode 100644 index 08700cc13..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "decimalId": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_array.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_array.json deleted file mode 100644 index 50d342db4..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_array.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "decimalArrayReturnRecord": { - "__typename": "Student5", - "id": 452, - "name": "Edward MacDell" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json deleted file mode 100644 index 3082ca772..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_decimal_or_nil.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "decimalId1": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float.json deleted file mode 100644 index c975117e0..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "floatId": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array.json deleted file mode 100644 index 2c6508074..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "floatArrayReturnRecord": { - "__typename": "Student5", - "id": 422, - "name": "Elliot Birch" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array1.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array1.json deleted file mode 100644 index c8b13a69b..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_array1.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "data": { - "floatArrayReturnRecordArray": [ - { - "name": "Beth Match", - "id": 789, - "age": 15 - }, - { - "name": "Jo March", - "id": 678, - "age": 16 - }, - { - "name": "Amy March", - "id": 543, - "age": 12 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_or_nil.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_or_nil.json deleted file mode 100644 index 3b807897f..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_float_or_nil.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "floatId1": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int.json deleted file mode 100644 index bb9df9fa7..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "intId": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int1.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int1.json deleted file mode 100644 index 2db607873..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int1.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "intIdReturnRecord": { - "__typename": "Student5", - "id": 2, - "name": "Jennifer Flackett" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_array.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_array.json deleted file mode 100644 index 72048aa97..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_array.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "intArrayReturnRecord": { - "__typename": "Student5", - "id": 333, - "name": "Antoni Porowski" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_or_nil.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_or_nil.json deleted file mode 100644 index a0fc0b217..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_int_or_nil.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "intId1": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record.json deleted file mode 100644 index 31eb77eb9..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "stringIdReturnRecord": { - "__typename": "PersonId", - "id": 543, - "name": "Marmee March" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record_array.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record_array.json deleted file mode 100644 index 82cff81f7..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_return_record_array.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "data": { - "stringArrayReturnRecordArray": [ - { - "__typename": "PersonId", - "id": 789, - "name": "Beth Match" - }, - { - "__typename": "PersonId", - "id": 678, - "name": "Jo March" - }, - { - "__typename": "PersonId", - "id": 543, - "name": "Amy March" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string.json deleted file mode 100644 index 90aa38bd0..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "stringId": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_array.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_array.json deleted file mode 100644 index 839f85e89..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_array.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "stringArrayReturnRecord": { - "__typename": "Student5", - "id": 212, - "name": "Andrew Glouberman" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_or_nil.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_or_nil.json deleted file mode 100644 index 88642a920..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_string_or_nil.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "stringId1": "Hello, World" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid.json deleted file mode 100644 index d3920b280..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "uuidReturnRecord": { - "__typename": "Student5", - "id": 2678, - "name": "Abuela Alvarez" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array.json deleted file mode 100644 index 6f2b8bd27..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "uuidArrayReturnRecord": { - "__typename": "Student5", - "id": 678, - "name": "Andy Garcia" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json b/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json deleted file mode 100644 index 148cad33b..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_input_type_validation_uuid_array_or_nil.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "uuidArrayReturnRecord1": { - "__typename": "Student5", - "id": 563, - "name": "Aretha Franklin" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/id_introspection_query.json b/ballerina-tests/tests/resources/expected_results/id_introspection_query.json deleted file mode 100644 index 7b16e14b7..000000000 --- a/ballerina-tests/tests/resources/expected_results/id_introspection_query.json +++ /dev/null @@ -1,640 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "kind": "OBJECT", - "name": "__Field", - "fields": [ - { - "name": "name", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String" - } - } - }, - { - "name": "description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "args", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - }, - { - "name": "type", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type" - } - } - }, - { - "name": "isDeprecated", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean" - } - } - }, - { - "name": "deprecationReason", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - ], - "inputFields": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "fields": null, - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "Query", - "fields": [ - { - "name": "student1", - "args": [ - { - "name": "id1", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID" - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Student1" - } - } - }, - { - "name": "student2", - "args": [ - { - "name": "id2", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Student2" - } - } - }, - { - "name": "student3", - "args": [ - { - "name": "id3", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Student3" - } - } - }, - { - "name": "student4", - "args": [ - { - "name": "id4", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID" - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Student4" - } - } - } - ], - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "fields": [ - { - "name": "description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "types", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - }, - { - "name": "queryType", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type" - } - } - }, - { - "name": "mutationType", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - { - "name": "subscriptionType", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - { - "name": "directives", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - } - ], - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "fields": [ - { - "name": "kind", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind" - } - } - }, - { - "name": "name", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "fields", - "args": [ - { - "name": "includeDeprecated", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null - } - } - }, - { - "name": "interfaces", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null - } - } - }, - { - "name": "possibleTypes", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null - } - } - }, - { - "name": "enumValues", - "args": [ - { - "name": "includeDeprecated", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null - } - } - }, - { - "name": "inputFields", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null - } - } - }, - { - "name": "ofType", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - ], - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "fields": [ - { - "name": "name", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String" - } - } - }, - { - "name": "description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "isDeprecated", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean" - } - } - }, - { - "name": "deprecationReason", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - ], - "inputFields": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "fields": null, - "inputFields": null - }, - { - "kind": "SCALAR", - "name": "String", - "fields": null, - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "Student3", - "fields": [ - { - "name": "id", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - } - ], - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "Student4", - "fields": [ - { - "name": "id", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID" - } - } - } - ], - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "Student1", - "fields": [ - { - "name": "id", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID" - } - } - } - ], - "inputFields": null - }, - { - "kind": "SCALAR", - "name": "ID", - "fields": null, - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "Student2", - "fields": [ - { - "name": "id", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - } - ], - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "fields": [ - { - "name": "name", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String" - } - } - }, - { - "name": "description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "type", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type" - } - } - }, - { - "name": "defaultValue", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - ], - "inputFields": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "fields": null, - "inputFields": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "fields": [ - { - "name": "name", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String" - } - } - }, - { - "name": "description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "name": "locations", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - }, - { - "name": "args", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null - } - } - } - ], - "inputFields": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/inline_fragment.json b/ballerina-tests/tests/resources/expected_results/inline_fragment.json deleted file mode 100644 index a262e49b5..000000000 --- a/ballerina-tests/tests/resources/expected_results/inline_fragment.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data": { - "people": [ - { - "address": { - "city": "London" - } - }, - { - "address": { - "city": "Albuquerque" - } - }, - { - "address": { - "city": "Hogwarts" - } - } - ], - "students": [ - { - "name": "John Doe" - }, - { - "name": "Jane Doe" - }, - { - "name": "Jonny Doe" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/inline_fragments_on_record_objects.json b/ballerina-tests/tests/resources/expected_results/inline_fragments_on_record_objects.json deleted file mode 100644 index e748c95f6..000000000 --- a/ballerina-tests/tests/resources/expected_results/inline_fragments_on_record_objects.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "teacher": { - "name": "Walter White" - }, - "student": { - "age": 25 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/inline_fragments_with_variables.json b/ballerina-tests/tests/resources/expected_results/inline_fragments_with_variables.json deleted file mode 100644 index fef03b7d6..000000000 --- a/ballerina-tests/tests/resources/expected_results/inline_fragments_with_variables.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "profile": { - "name": "Walter White", - "address": { - "city": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json b/ballerina-tests/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json deleted file mode 100644 index d3944db6a..000000000 --- a/ballerina-tests/tests/resources/expected_results/inline_nested_fragments_on_record_objects.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "teacher": { - "name": "Walter White", - "address": { - "city": "Albuquerque" - } - }, - "student": { - "age": 25, - "address": { - "city": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object.json b/ballerina-tests/tests/resources/expected_results/input_object.json deleted file mode 100644 index de0ec1768..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "searchProfile": { - "name": "Jessie Pinkman" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json deleted file mode 100644 index b5fe62116..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_complex_variables.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json deleted file mode 100644 index f8be76605..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_undefined_variables.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"$bName\" is not defined.", - "locations": [ - { - "line": 2, - "column": 28 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables.json deleted file mode 100644 index b5fe62116..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables_missing_values.json b/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables_missing_values.json deleted file mode 100644 index 147f2d8f4..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_include_fields_with_variables_missing_values.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"book\" argument \"movie\" of type \"Movie!\" is required, but it was not provided.", - "locations": [ - { - "line": 1, - "column": 7 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_type_variables_inside_list_value.json b/ballerina-tests/tests/resources/expected_results/input_object_type_variables_inside_list_value.json deleted file mode 100644 index 5d5d716f4..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_type_variables_inside_list_value.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Escape Plan" - }, - { - "movieName": "Papillon" - }, - { - "movieName": "The Fugitive" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json b/ballerina-tests/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json deleted file mode 100644 index a567b006e..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_variables_with_invalid_type_name.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Unknown type \"Details\".", - "locations": [ - { - "line": 1, - "column": 2 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_default_value.json b/ballerina-tests/tests/resources/expected_results/input_object_with_default_value.json deleted file mode 100644 index b5fe62116..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_default_value.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_duplicate_fields.json b/ballerina-tests/tests/resources/expected_results/input_object_with_duplicate_fields.json deleted file mode 100644 index 55d89b3f5..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_duplicate_fields.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Syntax Error: Duplicate input object field \"bookName\", found Name \"bookName\".", - "locations": [ - { - "line": 2, - "column": 35 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_enum_type_argument.json b/ballerina-tests/tests/resources/expected_results/input_object_with_enum_type_argument.json deleted file mode 100644 index d12cf6dcc..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_enum_type_argument.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_float_type_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_with_float_type_variables.json deleted file mode 100644 index 3187c4a26..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_float_type_variables.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data":{ - "weightInPounds":155.45250000000001 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_fragment_and_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_with_fragment_and_variables.json deleted file mode 100644 index 6accb2acb..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_fragment_and_variables.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "Harry Potter and the Sorcerer's Stone", - "author": "J.K Rowling" - }, - { - "name": "Harry Potter and the Chamber of Secrets", - "author": "J.K Rowling" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json deleted file mode 100644 index e61a9c5a3..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_inline_fragment_with_variables.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "The Sign of Four" - }, - { - "name": "The Valley of Fear" - }, - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments1.json b/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments1.json deleted file mode 100644 index 5da7ef30e..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments1.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "String cannot represent non String value: 5", - "locations": [ - { - "line": 2, - "column": 40 - } - ] - }, - { - "message": "Int cannot represent non Int value: Arthur", - "locations": [ - { - "line": 2, - "column": 48 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments2.json b/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments2.json deleted file mode 100644 index d3c88c768..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_arguments2.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "errors": [ - { - "message": "String! cannot represent non String! value: {name: \"s\"}", - "locations": [ - { - "line": 2, - "column": 17 - } - ] - }, - { - "message": "Int! cannot represent non Int! value: {}", - "locations": [ - { - "line": 2, - "column": 39 - } - ] - }, - { - "message": "String! cannot represent non String! value: {}", - "locations": [ - { - "line": 1, - "column": 42 - } - ] - }, - { - "message": "Int cannot represent non Int value: {}", - "locations": [ - { - "line": 1, - "column": 52 - } - ] - }, - { - "message": "String! cannot represent non String! value: {}", - "locations": [ - { - "line": 2, - "column": 77 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables1.json b/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables1.json deleted file mode 100644 index e0a794ab2..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables1.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Int cannot represent non Int value: 70.5", - "locations": [ - { - "line": 2, - "column": 30 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables2.json b/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables2.json deleted file mode 100644 index cd922ebb8..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_invalid_type_variables2.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "String cannot represent non String value: {}", - "locations": [ - { - "line": 2, - "column": 56 - } - ] - }, - { - "message": "Int cannot represent non Int value: {}", - "locations": [ - { - "line": 2, - "column": 56 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_missing_arguments.json b/ballerina-tests/tests/resources/expected_results/input_object_with_missing_arguments.json deleted file mode 100644 index 482ec1b35..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_missing_arguments.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"profileDetail.name\" of required type \"String!\" was not provided.", - "locations": [ - { - "line": 2, - "column": 19 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json b/ballerina-tests/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json deleted file mode 100644 index b5fe62116..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_missing_nullable_variable_value.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_missing_variables_arguments.json b/ballerina-tests/tests/resources/expected_results/input_object_with_missing_variables_arguments.json deleted file mode 100644 index da67fe1fd..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_missing_variables_arguments.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"name\" of required type \"String!\" was not provided.", - "locations": [ - { - "line": 2, - "column": 56 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_nested_input_object_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_with_nested_input_object_variables.json deleted file mode 100644 index e61a9c5a3..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_nested_input_object_variables.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "The Sign of Four" - }, - { - "name": "The Valley of Fear" - }, - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_nested_object.json b/ballerina-tests/tests/resources/expected_results/input_object_with_nested_object.json deleted file mode 100644 index 1a948bd12..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_nested_object.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "The Sign of Four", - "author": "Athur Conan Doyle" - }, - { - "name": "The Valley of Fear", - "author": "Athur Conan Doyle" - }, - { - "name": "Harry Potter and the Sorcerer's Stone", - "author": "J.K Rowling" - }, - { - "name": "Harry Potter and the Chamber of Secrets", - "author": "J.K Rowling" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_undefined_fields.json b/ballerina-tests/tests/resources/expected_results/input_object_with_undefined_fields.json deleted file mode 100644 index eb9d82830..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_undefined_fields.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"address\" is not defined by type \"author\".", - "locations": [ - { - "line": 2, - "column": 84 - } - ] - }, - { - "message": "Field \"year\" is not defined by type \"movie\".", - "locations": [ - { - "line": 2, - "column": 134 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_unexpected_variable_values.json b/ballerina-tests/tests/resources/expected_results/input_object_with_unexpected_variable_values.json deleted file mode 100644 index 1d70b0545..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_unexpected_variable_values.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "ProfileDetail cannot represent non ProfileDetail value: [{\"name\":\"arthur\"},{\"name\":\"J.K Rowling\"}]", - "locations": [ - { - "line": 3, - "column": 60 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_with_variables.json b/ballerina-tests/tests/resources/expected_results/input_object_with_variables.json deleted file mode 100644 index 1f046619d..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_with_variables.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "searchProfile": { - "name": "Sherlock Holmes" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_object_without_optional_fields.json b/ballerina-tests/tests/resources/expected_results/input_object_without_optional_fields.json deleted file mode 100644 index e61a9c5a3..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_object_without_optional_fields.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "book": [ - { - "name": "The Sign of Four" - }, - { - "name": "The Valley of Fear" - }, - { - "name": "Harry Potter and the Sorcerer's Stone" - }, - { - "name": "Harry Potter and the Chamber of Secrets" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json b/ballerina-tests/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json deleted file mode 100644 index fbd2f771d..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_parameter_type_not_present_in_return_types.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isLegal": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_escape_characters.json b/ballerina-tests/tests/resources/expected_results/input_with_escape_characters.json deleted file mode 100644 index 061fb5e81..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_escape_characters.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "type": "1.0.0" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter.json b/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter.json deleted file mode 100644 index 68c118525..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "name": "trigonocephalus" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_array.json b/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_array.json deleted file mode 100644 index 220167113..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_array.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "names": ["trigonocephalus", "philarchus"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference.json b/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference.json deleted file mode 100644 index 7061d4399..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "city": "Albuquerque" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json b/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json deleted file mode 100644 index c10378950..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_intersection_parameter_reference_array.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "cities": ["Albuquerque", "Albuquerque"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json b/ballerina-tests/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json deleted file mode 100644 index a14fbd75e..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_intersection_referring_non_intersection_type.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "commonName": "Sri Lankan Tree Nymph" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json b/ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json deleted file mode 100644 index d2840ffba..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "ownerName": "Sam" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json b/ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json deleted file mode 100644 index e8ddb5cdb..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_non_intersection_type_referring_intersection_type_as_a_variable.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "ownerName": "Ruwangi" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/input_with_unicode_characters.json b/ballerina-tests/tests/resources/expected_results/input_with_unicode_characters.json deleted file mode 100644 index 6a26ded93..000000000 --- a/ballerina-tests/tests/resources/expected_results/input_with_unicode_characters.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "version": "SwanLake" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptor_execution_order.json b/ballerina-tests/tests/resources/expected_results/interceptor_execution_order.json deleted file mode 100644 index e7f111c02..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptor_execution_order.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "quote": "Ballerina is an open-source programming language.", - "status": "Ballerina is a powerful general-purpose programming language." - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors.json b/ballerina-tests/tests/resources/expected_results/interceptors.json deleted file mode 100644 index c0726d85e..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data":{ - "enemy": "Harry Potter and the Chamber of Secrets --> Tom Marvolo Riddle - voldemort" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_returning_error1.json b/ballerina-tests/tests/resources/expected_results/interceptors_returning_error1.json deleted file mode 100644 index 1acf0ed2a..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_returning_error1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "This field is not accessible!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "greet" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_returning_error2.json b/ballerina-tests/tests/resources/expected_results/interceptors_returning_error2.json deleted file mode 100644 index 885c24d00..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_returning_error2.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "This field is not accessible!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "friends" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_returning_error3.json b/ballerina-tests/tests/resources/expected_results/interceptors_returning_error3.json deleted file mode 100644 index e1a97ca01..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_returning_error3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "This field is not accessible!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "person" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json b/ballerina-tests/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json deleted file mode 100644 index 3a68a122c..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_returning_errors_with_hierarchical_resources.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "errors": [ - { - "message": "Access denied!", - "locations": [ - { - "line": 3, - "column": 5 - } - ], - "path": [ - "age" - ] - }, - { - "message":"This field is not accessible!", - "locations":[ - { - "line":5, - "column":9 - } - ], - "path":[ - "address", - "city" - ] - }, - { - "message": "Access denied!", - "locations": [ - { - "line": 6, - "column": 9 - } - ], - "path": [ - "address", - "street" - ] - }, - { - "message": "Access denied!", - "locations": [ - { - "line": 7, - "column": 9 - } - ], - "path": [ - "address", - "number" - ] - } - ], - "data": { - "name": "Walter", - "age": null, - "address": { - "city": null, - "street": null, - "number": null - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_returning_invalid_value.json b/ballerina-tests/tests/resources/expected_results/interceptors_returning_invalid_value.json deleted file mode 100644 index 66c27ab26..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_returning_invalid_value.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "errors": [ - { - "message": "Invalid return type in Interceptor \"NullReturn1\". Expected type String!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "name" - ] - }, - { - "message":"Invalid return type in Interceptor \"NullReturn2\". Expected type Int!", - "locations":[ - { - "line":3, - "column":5 - } - ], - "path":[ - "age" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_arrays.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_arrays.json deleted file mode 100644 index 5a81f78c8..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_arrays.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "houses": [ - "Gryffindor(Fire)", - "Hufflepuff(Earth)", - "Ravenclaw(Air)", - "Slytherin(Water)" - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification1.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification1.json deleted file mode 100644 index 007809bab..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": { - "students": [ - { - "id": 3, - "name": "Minerva McGonagall" - } - ], - "teachers": [ - { - "id": 46, - "name": "Sybill Trelawney", - "subject": "Divination" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification2.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification2.json deleted file mode 100644 index e157bce3f..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_destructive_modification2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "students": ["Ballerina","GraphQL"], - "teachers": ["Hello","World!"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_enum.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_enum.json deleted file mode 100644 index a81e5880e..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_enum.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "holidays": ["SATURDAY", "SUNDAY", "MONDAY", "TUESDAY"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_fragments.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_fragments.json deleted file mode 100644 index c1f5f6173..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_fragments.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "teacher": { - "id": 3, - "name": "Minerva McGonagall", - "subject": "Transfiguration" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_hierarchical_paths.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_hierarchical_paths.json deleted file mode 100644 index 35148d026..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_hierarchical_paths.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "name": { - "first": "Harry", - "last": "Potter" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json deleted file mode 100644 index b63b53a5b..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification1.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "errors": [ - { - "message":"Invalid return type in Interceptor \"InvalidInterceptor9\". Expected type Int!", - "locations":[ - { - "line":2, - "column":5 - } - ], - "path":[ - "age" - ] - }, - { - "message":"Invalid return type in Interceptor \"InvalidInterceptor8\". Expected type Int!", - "locations":[ - { - "line":2, - "column":5 - } - ], - "path":[ - "age" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor2\". Expected type Int!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "age" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor1\". Expected type Int!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "age" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json deleted file mode 100644 index d153f12cd..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification2.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "errors": [ - { - "message":"Invalid return type in Interceptor \"InvalidInterceptor8\". Expected type [String!]!", - "locations":[ - { - "line":2, - "column":5 - } - ], - "path": [ - "friends" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor4\". Expected type [String!]!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "friends" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor3\". Expected type [String!]!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "friends" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json deleted file mode 100644 index 68e69f3ea..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification3.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "errors": [ - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor9\". Expected type Person!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "person" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor6\". Expected type Person!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "person" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor5\". Expected type Person!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "person" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor6\". Expected type Address!", - "locations": [ - { - "line": 4, - "column": 9 - } - ], - "path": [ - "person", - "address" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json deleted file mode 100644 index 7905be93d..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_invalid_destructive_modification4.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "errors": [ - { - "message":"Invalid return type in Interceptor \"InvalidInterceptor9\". Expected type StudentService!", - "locations":[ - { - "line":2, - "column":5 - } - ], - "path":[ - "student" - ] - }, - { - "message": "Invalid return type in Interceptor \"InvalidInterceptor7\". Expected type String!", - "locations": [ - { - "line": 4, - "column": 9 - } - ], - "path": [ - "student", - "name" - ] - } - ], - "data": { - "student": { - "id": 5, - "name": "Jessie" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_map.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_map.json deleted file mode 100644 index e4f4702c4..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_map.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "languages": { - "backend": "Java", - "name": "Flutter", - "data": "Ballerina", - "native": "C#" - }, - "updatedLanguages": { - "backend": "PHP", - "frontend": "JavaScript", - "data": "Python", - "native": "C#" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_mutation.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_mutation.json deleted file mode 100644 index 7da570ec1..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_mutation.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "setName": { - "name": "Albus Percival Wulfric Brian Dumbledore" - }, - "setAge": { - "name": "Albert", - "age": 53 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_null_value1.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_null_value1.json deleted file mode 100644 index 895d79875..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_null_value1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "name": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_null_value2.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_null_value2.json deleted file mode 100644 index 6f4116a3f..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_null_value2.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "name": null, - "age": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_record_fields.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_record_fields.json deleted file mode 100644 index a0835072e..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_record_fields.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "errors": [ - { - "message": "Access denied!", - "locations": [ - { - "line": 11, - "column": 5 - } - ], - "path": [ - "newProfile" - ] - } - ], - "data": { - "profile": { - "name": "Albus Percival Wulfric Brian Dumbledore", - "age": 80, - "address": { - "number": "100", - "street": "Margo Street", - "city": "London" - } - }, - "newProfile": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_records.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_records.json deleted file mode 100644 index 62fd279e3..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_records.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "userProfile": { - "name": "Rubeus Hagrid", - "userName": "Rubeus Hagrid", - "homeAddress": { - "number": "103", - "streetName": "Mould-on-the-Wold" - } - }, - "contactDetails": { - "number": "+87654321" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_records_and_fragments.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_records_and_fragments.json deleted file mode 100644 index 50a1bbe05..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_records_and_fragments.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "errors": [ - { - "message": "Access denied!", - "locations": [ - { - "line": 7, - "column": 5 - } - ], - "path": [ - "newProfile" - ] - } - ], - "data": { - "profile": { - "name": "Albus Percival Wulfric Brian Dumbledore", - "age": 80, - "address": { - "number": "100", - "street": "Margo Street", - "city": "London" - } - }, - "newProfile": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_service_object.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_service_object.json deleted file mode 100644 index 7a13c6d78..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_service_object.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "data": { - "teacher": { - "id": 3, - "name": "Minerva McGonagall", - "subject": "Transfiguration" - }, - "student": { - "id": 45, - "name": "Ron Weasley" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_table.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_table.json deleted file mode 100644 index a29e3aedc..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_table.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "data": { - "employees": [ - { - "name": "Eng. John Doe" - }, - { - "name": "Eng. Jane Doe" - }, - { - "name": "Eng. Johnny Roe" - } - ], - "oldEmployees":[ - { - "name":"John" - }, - { - "name":"Jane" - }, - { - "name":"Johnny" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interceptors_with_union.json b/ballerina-tests/tests/resources/expected_results/interceptors_with_union.json deleted file mode 100644 index e7acaa15e..000000000 --- a/ballerina-tests/tests/resources/expected_results/interceptors_with_union.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "data": { - "profile1": { - "id": 3, - "name": "Minerva McGonagall" - }, - "profile2": { - "id": 4, - "name": "Minerva McGonagall", - "subject": "Black Magic" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interface_field.json b/ballerina-tests/tests/resources/expected_results/interface_field.json deleted file mode 100644 index c778c86b4..000000000 --- a/ballerina-tests/tests/resources/expected_results/interface_field.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "data": { - "characters": [ - { - "name": "Luke Skywalker" - }, - { - "name": "R2D2" - } - ] - } -} - diff --git a/ballerina-tests/tests/resources/expected_results/interface_introspection.json b/ballerina-tests/tests/resources/expected_results/interface_introspection.json deleted file mode 100644 index 4852a4e07..000000000 --- a/ballerina-tests/tests/resources/expected_results/interface_introspection.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "Human", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "__Field", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "__TypeKind", - "kind": "ENUM", - "possibleTypes": null - }, - { - "name": "Query", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "Character", - "kind": "INTERFACE", - "possibleTypes": [ - { - "name": "Human", - "kind": "OBJECT" - }, - { - "name": "Droid", - "kind": "OBJECT" - } - ] - }, - { - "name": "__Schema", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "__Type", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "__EnumValue", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "__DirectiveLocation", - "kind": "ENUM", - "possibleTypes": null - }, - { - "name": "String", - "kind": "SCALAR", - "possibleTypes": null - }, - { - "name": "Int", - "kind": "SCALAR", - "possibleTypes": null - }, - { - "name": "Droid", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "Starship", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "Ship", - "kind": "INTERFACE", - "possibleTypes": [ - { - "name": "Starship", - "kind": "OBJECT" - } - ] - }, - { - "name": "__InputValue", - "kind": "OBJECT", - "possibleTypes": null - }, - { - "name": "Boolean", - "kind": "SCALAR", - "possibleTypes": null - }, - { - "name": "__Directive", - "kind": "OBJECT", - "possibleTypes": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interfaces.json b/ballerina-tests/tests/resources/expected_results/interfaces.json deleted file mode 100644 index 26b76bdf8..000000000 --- a/ballerina-tests/tests/resources/expected_results/interfaces.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "characters": [ - { - "name": "Luke Skywalker", - "id": 1 - }, - { - "name": "R2D2", - "year": 1977 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interfaces_with_interface_type_array.json b/ballerina-tests/tests/resources/expected_results/interfaces_with_interface_type_array.json deleted file mode 100644 index cd9bf3f3d..000000000 --- a/ballerina-tests/tests/resources/expected_results/interfaces_with_interface_type_array.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data": { - "ships": [ - { - "id": "E1", - "enemyShips": [ - { - "id": "E3", - "driver": "Han" - }, - { - "id": "E4", - "driver": "Leia" - } - ] - }, - { - "id": "E2", - "enemyShips": [ - { - "id": "E3", - "driver": "Han" - }, - { - "id": "E4", - "driver": "Leia" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interfaces_with_invalid_field.json b/ballerina-tests/tests/resources/expected_results/interfaces_with_invalid_field.json deleted file mode 100644 index 0fec401f2..000000000 --- a/ballerina-tests/tests/resources/expected_results/interfaces_with_invalid_field.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"age\" on type \"Character\". Did you mean to use a fragment on a subtype?", - "locations": [ - { - "line": 9, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/interfaces_with_nested_fragments.json b/ballerina-tests/tests/resources/expected_results/interfaces_with_nested_fragments.json deleted file mode 100644 index 26b76bdf8..000000000 --- a/ballerina-tests/tests/resources/expected_results/interfaces_with_nested_fragments.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "characters": [ - { - "name": "Luke Skywalker", - "id": 1 - }, - { - "name": "R2D2", - "year": 1977 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/interfaces_with_type_name_introspection.json b/ballerina-tests/tests/resources/expected_results/interfaces_with_type_name_introspection.json deleted file mode 100644 index 27bdd0947..000000000 --- a/ballerina-tests/tests/resources/expected_results/interfaces_with_type_name_introspection.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "characters": [ - { - "__typename": "Human", - "name": "Luke Skywalker", - "id": 1 - }, - { - "__typename": "Droid", - "name": "R2D2", - "year": 1977 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/introspection_for_person_and_greet.json b/ballerina-tests/tests/resources/expected_results/introspection_for_person_and_greet.json deleted file mode 100644 index 435293166..000000000 --- a/ballerina-tests/tests/resources/expected_results/introspection_for_person_and_greet.json +++ /dev/null @@ -1,973 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "name": "Query" - }, - "mutationType": null, - "subscriptionType": null, - "types": [ - { - "kind": "ENUM", - "name": "__TypeKind", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "INPUT_OBJECT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": null, - "fields": [ - { - "name": "args", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Query", - "description": null, - "fields": [ - { - "name": "person", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Person", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "greet", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Address", - "description": null, - "fields": [ - { - "name": "number", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "city", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "street", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": null, - "fields": [ - { - "name": "types", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": null, - "fields": [ - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": null, - "fields": [ - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "INPUT_FIELD_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "QUERY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": null, - "fields": [ - { - "name": "defaultValue", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Person", - "description": null, - "fields": [ - { - "name": "address", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Address", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "age", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": null, - "fields": [ - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - } - ], - "directives": [] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/introspection_on_service_with_input_objects.json b/ballerina-tests/tests/resources/expected_results/introspection_on_service_with_input_objects.json deleted file mode 100644 index ffd15b87c..000000000 --- a/ballerina-tests/tests/resources/expected_results/introspection_on_service_with_input_objects.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "Movie", - "inputFields": [ - { - "name": "movieName", - "type": { - "kind": "NON_NULL" - } - }, - { - "name": "director", - "type": { - "kind": "SCALAR" - } - } - ] - }, - { - "name": "__Field", - "inputFields": null - }, - { - "name": "__TypeKind", - "inputFields": null - }, - { - "name": "Query", - "inputFields": null - }, - { - "name": "Address", - "inputFields": null - }, - { - "name": "__Schema", - "inputFields": null - }, - { - "name": "__Type", - "inputFields": null - }, - { - "name": "__EnumValue", - "inputFields": null - }, - { - "name": "__DirectiveLocation", - "inputFields": null - }, - { - "name": "String", - "inputFields": null - }, - { - "name": "Info", - "inputFields": [ - { - "name": "bookName", - "type": { - "kind": "NON_NULL" - } - }, - { - "name": "edition", - "type": { - "kind": "NON_NULL" - } - }, - { - "name": "author", - "type": { - "kind": "NON_NULL" - } - }, - { - "name": "movie", - "type": { - "kind": "INPUT_OBJECT" - } - } - ] - }, - { - "name": "Int", - "inputFields": null - }, - { - "name": "Date", - "inputFields": [ - { - "name": "day", - "type": { - "kind": "NON_NULL" - } - } - ] - }, - { - "name": "Weight", - "inputFields": [ - { - "name": "weightInKg", - "type": { - "kind": "NON_NULL" - } - } - ] - }, - { - "name": "DefaultPerson", - "inputFields": [ - { - "name": "name", - "type": { - "kind": "NON_NULL" - } - }, - { - "name": "addresses", - "type": { - "kind": "NON_NULL" - } - } - ] - }, - { - "name": "Weekday", - "inputFields": null - }, - { - "name": "Float", - "inputFields": null - }, - { - "name": "ProfileDetail", - "inputFields": [ - { - "name": "name", - "type": { - "kind": "NON_NULL" - } - }, - { - "name": "age", - "type": { - "kind": "SCALAR" - } - } - ] - }, - { - "name": "Book", - "inputFields": null - }, - { - "name": "WeightInKg", - "inputFields": [ - { - "name": "weight", - "type": { - "kind": "NON_NULL" - } - } - ] - }, - { - "name": "__InputValue", - "inputFields": null - }, - { - "name": "Boolean", - "inputFields": null - }, - { - "name": "Person", - "inputFields": null - }, - { - "name": "__Directive", - "inputFields": null - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/introspection_on_subgraph.json b/ballerina-tests/tests/resources/expected_results/introspection_on_subgraph.json deleted file mode 100644 index 168ae1be2..000000000 --- a/ballerina-tests/tests/resources/expected_results/introspection_on_subgraph.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "link__Purpose", - "kind": "ENUM" - }, - { - "name": "__TypeKind", - "kind": "ENUM" - }, - { - "name": "Query", - "kind": "OBJECT" - }, - { - "name": "__Type", - "kind": "OBJECT" - }, - { - "name": "__EnumValue", - "kind": "OBJECT" - }, - { - "name": "Moon", - "kind": "OBJECT" - }, - { - "name": "ReviewData", - "kind": "OBJECT" - }, - { - "name": "Satellite", - "kind": "OBJECT" - }, - { - "name": "String", - "kind": "SCALAR" - }, - { - "name": "Int", - "kind": "SCALAR" - }, - { - "name": "_Entity", - "kind": "UNION" - }, - { - "name": "FieldSet", - "kind": "SCALAR" - }, - { - "name": "Decimal", - "kind": "SCALAR" - }, - { - "name": "Star", - "kind": "OBJECT" - }, - { - "name": "_Service", - "kind": "OBJECT" - }, - { - "name": "Planet", - "kind": "OBJECT" - }, - { - "name": "Boolean", - "kind": "SCALAR" - }, - { - "name": "ProductData", - "kind": "OBJECT" - }, - { - "name": "_Any", - "kind": "SCALAR" - }, - { - "name": "__Field", - "kind": "OBJECT" - }, - { - "name": "__Schema", - "kind": "OBJECT" - }, - { - "name": "__DirectiveLocation", - "kind": "ENUM" - }, - { - "name": "link__Import", - "kind": "SCALAR" - }, - { - "name": "__InputValue", - "kind": "OBJECT" - }, - { - "name": "__Directive", - "kind": "OBJECT" - } - ] - }, - "Query": { - "name": "Query", - "fields": [ - { - "name": "greet", - "args": [] - }, - { - "name": "_service", - "args": [] - }, - { - "name": "_entities", - "args": [ - { - "name": "representations", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "LIST", - "ofType": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "_Any", - "ofType": null - } - } - } - } - } - ] - } - ] - }, - "_Entity": { - "name": "_Entity", - "possibleTypes": [ - { - "name": "ProductData" - }, - { - "name": "Moon" - }, - { - "name": "Star" - }, - { - "name": "Satellite" - }, - { - "name": "Planet" - } - ] - }, - "Service": { - "name": "_Service", - "fields": [ - { - "name": "sdl", - "type": { - "kind": "NON_NULL", - "ofType": { - "kind": "SCALAR", - "name": "String" - } - } - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/introspection_query_with_missing_selection.json b/ballerina-tests/tests/resources/expected_results/introspection_query_with_missing_selection.json deleted file mode 100644 index 48abebd69..000000000 --- a/ballerina-tests/tests/resources/expected_results/introspection_query_with_missing_selection.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"__schema\" of type \"__Schema\" must have a selection of subfields. Did you mean \"__schema { ... }\"?", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_block_strings.json b/ballerina-tests/tests/resources/expected_results/invalid_block_strings.json deleted file mode 100644 index 2e1cabdbe..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_block_strings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Syntax Error: Expected \":\", found Name \"GraphQL\".", - "locations": [ - { - "line": 6, - "column": 13 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_complexity_query.json b/ballerina-tests/tests/resources/expected_results/invalid_complexity_query.json deleted file mode 100644 index c2b956f3f..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_complexity_query.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "The operation ComplexQuery exceeds the maximum query complexity threshold. Maximum allowed complexity: 20, actual complexity: 48", - "locations": [ - { - "line": 1, - "column": 1 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json b/ballerina-tests/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json deleted file mode 100644 index 53d0cea25..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_enum_type_default_value_with_variables.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Value \"SNDAY\" does not exist in \"weekday\" enum.", - "locations": [ - { - "line": 1, - "column": 17 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_hierarchical_resource_paths.json b/ballerina-tests/tests/resources/expected_results/invalid_hierarchical_resource_paths.json deleted file mode 100644 index e43bc0391..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_hierarchical_resource_paths.json +++ /dev/null @@ -1,14 +0,0 @@ - -{ - "errors": [ - { - "message": "Cannot query field \"middle\" on type \"name\".", - "locations": [ - { - "line": 5, - "column": 13 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_introspection_query.json b/ballerina-tests/tests/resources/expected_results/invalid_introspection_query.json deleted file mode 100644 index 0dd497024..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_introspection_query.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"greet\" on type \"__Schema\".", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_list_type_for_input_objects.json b/ballerina-tests/tests/resources/expected_results/invalid_list_type_for_input_objects.json deleted file mode 100644 index 9866cdab3..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_list_type_for_input_objects.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "TvSeries! cannot represent non TvSeries! value: [{name: \"Breaking Bad\", episodes:[{title: \"Cancer Man\", newCharacters:[true, \"graphql\"]}]}]", - "locations": [ - { - "line": 2, - "column": 14 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects.json b/ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects.json deleted file mode 100644 index 1401322f9..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "String cannot represent non String value: true", - "locations": [ - { - "line": 2, - "column": 95 - } - ] - }, - { - "message": "String cannot represent non String value: graphql", - "locations": [ - { - "line": 2, - "column": 101 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json b/ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json deleted file mode 100644 index 62aecb036..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_list_type_within_input_objects_with_variables.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "String cannot represent non String value: true", - "locations": [ - { - "line": 2, - "column": 25 - } - ] - }, - { - "message": "String cannot represent non String value: 44", - "locations": [ - { - "line": 2, - "column": 25 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_mutation.json b/ballerina-tests/tests/resources/expected_results/invalid_mutation.json deleted file mode 100644 index 9538e5047..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_mutation.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"setAge\" on type \"Mutation\".", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_query_from_service_object_resource.json b/ballerina-tests/tests/resources/expected_results/invalid_query_from_service_object_resource.json deleted file mode 100644 index 32ff80d90..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_query_from_service_object_resource.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"nonExisting\" on type \"Name\".", - "locations": [ - { - "line": 4, - "column": 13 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json b/ballerina-tests/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json deleted file mode 100644 index e8e1b7461..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_query_with_distinct_service_unions.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"name\" on type \"StudentService_TeacherService\". Did you mean to use a fragment on \"StudentService\" or \"TeacherService\"?", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_schema_introspection_field.json b/ballerina-tests/tests/resources/expected_results/invalid_schema_introspection_field.json deleted file mode 100644 index 8f8e59fd7..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_schema_introspection_field.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"__schema\" on type \"Person\".", - "locations": [ - { - "line": 4, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_spread_inline_fragments.json b/ballerina-tests/tests/resources/expected_results/invalid_spread_inline_fragments.json deleted file mode 100644 index c5f35b40a..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_spread_inline_fragments.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Fragment cannot be spread here as objects of type \"__Type\" can never be of type \"Student\".", - "locations": [ - { - "line": 4, - "column": 13 - } - ] - }, - { - "message": "Fragment cannot be spread here as objects of type \"__Type\" can never be of type \"Person\".", - "locations": [ - { - "line": 7, - "column": 13 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json b/ballerina-tests/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json deleted file mode 100644 index f737e3f35..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_value_with_nested_list_in_input_objects.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "[Episode!] cannot represent non [Episode!] value: {title: \"Cancer Man\", newCharacters:[\"paul\"]}", - "locations": [ - { - "line": 2, - "column": 48 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/invalid_variables_inside_list_value.json b/ballerina-tests/tests/resources/expected_results/invalid_variables_inside_list_value.json deleted file mode 100644 index 8e8ea0aec..000000000 --- a/ballerina-tests/tests/resources/expected_results/invalid_variables_inside_list_value.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"p1\" of type \"ProfileDetail\" used in position expecting type \"ProfileDetail!\".", - "locations": [ - { - "line": 2, - "column": 35 - } - ] - }, - { - "message": "Variable \"$p2\" of required type ProfileDetail! was not provided.", - "locations": [ - { - "line": 2, - "column": 40 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_input copy.json b/ballerina-tests/tests/resources/expected_results/list_type_input copy.json deleted file mode 100644 index 78e22dc7e..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_input copy.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello! This is Ballerina GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_input.json b/ballerina-tests/tests/resources/expected_results/list_type_input.json deleted file mode 100644 index 78e22dc7e..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello! This is Ballerina GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_input_with_empty_value.json b/ballerina-tests/tests/resources/expected_results/list_type_input_with_empty_value.json deleted file mode 100644 index 974f37339..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_input_with_empty_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Word list is empty" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_input_with_invalid_variables.json b/ballerina-tests/tests/resources/expected_results/list_type_input_with_invalid_variables.json deleted file mode 100644 index 9564ae38d..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_input_with_invalid_variables.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "words: In element #1:String cannot represent non String value: true", - "locations": [ - { - "line": 2, - "column": 20 - } - ] - }, - { - "message": "words: In element #3:String cannot represent non String value: 4", - "locations": [ - { - "line": 2, - "column": 20 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_input_with_null_value.json b/ballerina-tests/tests/resources/expected_results/list_type_input_with_null_value.json deleted file mode 100644 index cf7916b62..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_input_with_null_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello! This is a Null Value ->" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_input_with_variable.json b/ballerina-tests/tests/resources/expected_results/list_type_input_with_variable.json deleted file mode 100644 index 78e22dc7e..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_input_with_variable.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello! This is Ballerina GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_inputs_with_nested_list.json b/ballerina-tests/tests/resources/expected_results/list_type_inputs_with_nested_list.json deleted file mode 100644 index 9084b6fc2..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_inputs_with_nested_list.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getTotal": [9.0, 22.0, 27.0] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_variables_inside_list_value.json b/ballerina-tests/tests/resources/expected_results/list_type_variables_inside_list_value.json deleted file mode 100644 index 9084b6fc2..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_variables_inside_list_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getTotal": [9.0, 22.0, 27.0] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_input_objects.json b/ballerina-tests/tests/resources/expected_results/list_type_variables_with_input_objects.json deleted file mode 100644 index 8aedf7c0c..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_input_objects.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "El Camino" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json b/ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json deleted file mode 100644 index e6b89e295..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_input_objects.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "tvSeries: In element #1:[Episode!] cannot represent non [Episode!] value: true", - "locations": [ - { - "line": 2, - "column": 31 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json b/ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json deleted file mode 100644 index 3381f98c1..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_invalid_nested_list_in_input_object.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "tvSeries: In element #0:String cannot represent non String value: true", - "locations": [ - { - "line": 2, - "column": 31 - } - ] - }, - { - "message": "tvSeries: In element #0:String cannot represent non String value: 1", - "locations": [ - { - "line": 2, - "column": 31 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json b/ballerina-tests/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json deleted file mode 100644 index 5d5d716f4..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_variables_with_nested_list_in_input_object.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Escape Plan" - }, - { - "movieName": "Papillon" - }, - { - "movieName": "The Fugitive" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_default_value.json b/ballerina-tests/tests/resources/expected_results/list_type_with_default_value.json deleted file mode 100644 index 1f4f9444b..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_default_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isIncludeHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_enum_values.json b/ballerina-tests/tests/resources/expected_results/list_type_with_enum_values.json deleted file mode 100644 index b172ce456..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_enum_values.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isIncludeHoliday": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_input_objects.json b/ballerina-tests/tests/resources/expected_results/list_type_with_input_objects.json deleted file mode 100644 index 8aedf7c0c..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_input_objects.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "El Camino" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_enum_values.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_enum_values.json deleted file mode 100644 index ff71f1f6f..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_enum_values.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Value \"WEdnesday\" does not exist in \"days\" enum.", - "locations": [ - { - "line": 2, - "column": 64 - } - ] - }, - { - "message": "days: In element #5:Enum \"Weekday\" cannot represent non-enum value: \"4\"", - "locations": [ - { - "line": 2, - "column": 75 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json deleted file mode 100644 index 8303c81b6..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_input_objects_value.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "tvSeries: In element #1:[Episode!] cannot represent non [Episode!] value: true", - "locations": [ - { - "line": 2, - "column": 116 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json deleted file mode 100644 index 223e438e9..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_nested_list_in_input_object.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "tvSeries: In element #0:String cannot represent non String value: true", - "locations": [ - { - "line": 2, - "column": 139 - } - ] - }, - { - "message": "tvSeries: In element #0:String cannot represent non String value: 4", - "locations": [ - { - "line": 2, - "column": 145 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json deleted file mode 100644 index ac3c49087..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_1.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"words: In element #3:\" expected value of type \"String\", found Ballerina", - "locations": [ - { - "line": 1, - "column": 52 - } - ] - }, - { - "message": "Variable \"words: In element #4:\" expected value of type \"String\", found true", - "locations": [ - { - "line": 1, - "column": 63 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json deleted file mode 100644 index 98c2331a1..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_2.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"words: In element #0:\" expected value of type \"Int\", found Hello!", - "locations": [ - { - "line": 1, - "column": 25 - } - ] - }, - { - "message": "Variable \"words: In element #1:\" expected value of type \"Int\", found This", - "locations": [ - { - "line": 1, - "column": 35 - } - ] - }, - { - "message": "Variable \"words: In element #2:\" expected value of type \"Int\", found is", - "locations": [ - { - "line": 1, - "column": 43 - } - ] - }, - { - "message": "Variable \"words: In element #3:\" expected value of type \"Int\", found Ballerina", - "locations": [ - { - "line": 1, - "column": 49 - } - ] - }, - { - "message": "Variable \"words: In element #4:\" expected value of type \"Int\", found GraphQL", - "locations": [ - { - "line": 1, - "column": 62 - } - ] - }, - { - "message": "Variable \"words\" of type \"[Int]\" used in position expecting type \"[String]\".", - "locations": [ - { - "line": 2, - "column": 20 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json deleted file mode 100644 index a913f89c7..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_3.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"prices: In element #0: In element #1:\" expected value of type \"Float!\", found true", - "locations": [ - { - "line": 1, - "column": 36 - } - ] - }, - { - "message": "Variable \"prices: In element #1:\" expected value of type \"[Float!]!\", found false", - "locations": [ - { - "line": 1, - "column": 46 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json deleted file mode 100644 index 6279ecd98..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_4.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"prices: In element #0:\" expected value of type \"[Float!]!\", found 2", - "locations": [ - { - "line": 1, - "column": 33 - } - ] - }, - { - "message": "Variable \"prices: In element #1:\" expected value of type \"[Float!]!\", found 3", - "locations": [ - { - "line": 1, - "column": 36 - } - ] - }, - { - "message": "Variable \"prices: In element #2:\" expected value of type \"[Float!]!\", found 4", - "locations": [ - { - "line": 1, - "column": 39 - } - ] - }, - { - "message": "Variable \"prices: In element #3:\" expected value of type \"[Float!]!\", found 5", - "locations": [ - { - "line": 1, - "column": 42 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json deleted file mode 100644 index 18b89f866..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_5.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"prices: In element #0:\" expected value of type \"[Float!]!\", found []", - "locations": [ - { - "line": 1, - "column": 33 - } - ] - }, - { - "message": "Variable \"prices: In element #2: In element #0:\" expected value of type \"Float!\", found null", - "locations": [ - { - "line": 1, - "column": 45 - } - ] - }, - { - "message": "Variable \"prices: In element #3:\" expected value of type \"[Float!]!\", found null", - "locations": [ - { - "line": 1, - "column": 52 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json deleted file mode 100644 index 5de0434a9..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_6.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "[[Float!]!]! cannot represent non [[Float!]!]! value: null", - "locations": [ - { - "line": 1, - "column": 31 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json deleted file mode 100644 index 8675d2131..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_7.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"profileDetail: In element #1:\" expected value of type \"ProfileDetail\", found []", - "locations": [ - { - "line": 1, - "column": 50 - } - ] - }, - { - "message": "Variable \"profileDetail\" of type \"[ProfileDetail]\" used in position expecting type \"[ProfileDetail!]!\".", - "locations": [ - { - "line": 2, - "column": 35 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json deleted file mode 100644 index 5b795a935..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_8.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Variable \"days\" of type \"[Weekday]\" used in position expecting type \"[Weekday!]!\".", - "locations": [ - { - "line": 2, - "column": 29 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json b/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json deleted file mode 100644 index 7109a4e54..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_invalid_variable_default_values_9.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Value \"TUSDAY\" does not exist in \"days\" enum.", - "locations": [ - { - "line": 1, - "column": 44 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json b/ballerina-tests/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json deleted file mode 100644 index 5d5d716f4..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_nested_list_in_input_object.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Escape Plan" - }, - { - "movieName": "Papillon" - }, - { - "movieName": "The Fugitive" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_1.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_1.json deleted file mode 100644 index 78e22dc7e..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello! This is Ballerina GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_2.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_2.json deleted file mode 100644 index 974f37339..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Word list is empty" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_3.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_3.json deleted file mode 100644 index 13bb93db9..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_4.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_4.json deleted file mode 100644 index 4fe3ad886..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "getTotal": [6.0, 155.0] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_5.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_5.json deleted file mode 100644 index 9f0700458..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_5.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "searchProfile": [ - { - "name": "Jessie Pinkman", - "age": 26 - }, - { - "name": "Sherlock Holmes", - "age": 40 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_6.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_6.json deleted file mode 100644 index 9f0700458..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_6.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "searchProfile": [ - { - "name": "Jessie Pinkman", - "age": 26 - }, - { - "name": "Sherlock Holmes", - "age": 40 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_7.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_7.json deleted file mode 100644 index 059414452..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_7.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Escape Plan", - "director": "Mikael Hafstrom" - }, - { - "movieName": "Papillon", - "director": "Franklin Schaffner" - }, - { - "movieName": "The Fugitive", - "director": "Andrew Davis" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_8.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_8.json deleted file mode 100644 index 7ed229f5f..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_8.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "getMovie": [ - { - "movieName": "Sherlock Holmes", - "director": "Dexter Fletcher" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_9.json b/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_9.json deleted file mode 100644 index b172ce456..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_with_variable_default_values_9.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isIncludeHoliday": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_within_input_objects.json b/ballerina-tests/tests/resources/expected_results/list_type_within_input_objects.json deleted file mode 100644 index 5c9c90c9a..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_within_input_objects.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "getMovie": [ - { - "movieName": "El Camino", - "director": "Vince Gilligan" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/list_type_within_input_objects_with_variables.json b/ballerina-tests/tests/resources/expected_results/list_type_within_input_objects_with_variables.json deleted file mode 100644 index 7ed229f5f..000000000 --- a/ballerina-tests/tests/resources/expected_results/list_type_within_input_objects_with_variables.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "getMovie": [ - { - "movieName": "Sherlock Holmes", - "director": "Dexter Fletcher" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/map.json b/ballerina-tests/tests/resources/expected_results/map.json deleted file mode 100644 index 5016307d3..000000000 --- a/ballerina-tests/tests/resources/expected_results/map.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "company": { - "workers": { - "name": "John Doe" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/map_with_invalid_key.json b/ballerina-tests/tests/resources/expected_results/map_with_invalid_key.json deleted file mode 100644 index 1a410bde2..000000000 --- a/ballerina-tests/tests/resources/expected_results/map_with_invalid_key.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "errors": [{ - "message": "The field \"name\" is a map, but it does not contain the key \"desktop\"", - "locations": [{ - "line": 4, - "column": 9 - }], - "path": ["languages", "desktop"] - }, - { - "message": "The field \"name\" is a map, but it does not contain the key \"deployment\"", - "locations": [{ - "line": 6, - "column": 9 - }], - "path": ["languages", "deploy"] - } - ], - "data": null -} \ No newline at end of file diff --git a/ballerina-tests/tests/resources/expected_results/map_with_valid_key.json b/ballerina-tests/tests/resources/expected_results/map_with_valid_key.json deleted file mode 100644 index a576c3252..000000000 --- a/ballerina-tests/tests/resources/expected_results/map_with_valid_key.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "languages": { - "backend": "Ballerina" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/map_without_key_input.json b/ballerina-tests/tests/resources/expected_results/map_without_key_input.json deleted file mode 100644 index 7e9fc276e..000000000 --- a/ballerina-tests/tests/resources/expected_results/map_without_key_input.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"workers\" argument \"key\" of type \"String!\" is required, but it was not provided.", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/multiple_directive_usage_in_fields.json b/ballerina-tests/tests/resources/expected_results/multiple_directive_usage_in_fields.json deleted file mode 100644 index 9658edb6c..000000000 --- a/ballerina-tests/tests/resources/expected_results/multiple_directive_usage_in_fields.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "detective": { - "address": { - "street": "Baker Street" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/multiple_mutations.json b/ballerina-tests/tests/resources/expected_results/multiple_mutations.json deleted file mode 100644 index 17c4af627..000000000 --- a/ballerina-tests/tests/resources/expected_results/multiple_mutations.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "setName": { - "name": "Heisenberg", - "address": { - "city": "Albuquerque" - } - }, - "setCity": { - "name": "Heisenberg", - "address": { - "city": "New Hampshire" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/multiple_mutations_on_service_objects.json b/ballerina-tests/tests/resources/expected_results/multiple_mutations_on_service_objects.json deleted file mode 100644 index cffdfc5ca..000000000 --- a/ballerina-tests/tests/resources/expected_results/multiple_mutations_on_service_objects.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "setTeacherSubject": { - "subject": "Chemistry", - "name": "Walter Bishop" - }, - "setTeacherName": { - "name": "Walter White", - "subject": "Chemistry" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/multiple_variable_types_with_single_query.json b/ballerina-tests/tests/resources/expected_results/multiple_variable_types_with_single_query.json deleted file mode 100644 index 351e33765..000000000 --- a/ballerina-tests/tests/resources/expected_results/multiple_variable_types_with_single_query.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "greet": "Hello, Thisaru", - "isLegal": true, - "weightInPounds": 155.45250000000001, - "isHoliday": false, - "getDay": [ - "MONDAY", - "TUESDAY", - "WEDNESDAY", - "THURSDAY", - "FRIDAY" - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/mutation.json b/ballerina-tests/tests/resources/expected_results/mutation.json deleted file mode 100644 index f88a23419..000000000 --- a/ballerina-tests/tests/resources/expected_results/mutation.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "setName": { - "name": "Heisenberg" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json b/ballerina-tests/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json deleted file mode 100644 index 8da779592..000000000 --- a/ballerina-tests/tests/resources/expected_results/mutation_request_on_non_mutable_schema.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Schema is not configured for mutations.", - "locations": [ - { - "line": 1, - "column": 1 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/mutation_type_introspection.json b/ballerina-tests/tests/resources/expected_results/mutation_type_introspection.json deleted file mode 100644 index 1413c9332..000000000 --- a/ballerina-tests/tests/resources/expected_results/mutation_type_introspection.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "data": { - "__schema": { - "mutationType": { - "kind": "OBJECT", - "fields": [ - { - "name": "setName" - }, - { - "name": "setCity" - }, - { - "name": "setTeacherName" - }, - { - "name": "setTeacherSubject" - } - ] - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/named_fragments_with_duplicate_fields.json b/ballerina-tests/tests/resources/expected_results/named_fragments_with_duplicate_fields.json deleted file mode 100644 index 55a92a0c8..000000000 --- a/ballerina-tests/tests/resources/expected_results/named_fragments_with_duplicate_fields.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "data": { - "people": [ - { - "address": { - "city": "London", - "street":"Baker Street", - "number":"221/B" - } - }, - { - "address": { - "city": "Albuquerque", - "street":"Negra Arroyo Lane", - "number":"308" - } - }, - { - "address": { - "city": "Hogwarts", - "street": "Unknown", - "number":"Uknown" - } - } - ], - "students": [ - { - "name": "John Doe" - }, - { - "name": "Jane Doe" - }, - { - "name": "Jonny Doe" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_fragments.json b/ballerina-tests/tests/resources/expected_results/nested_fragments.json deleted file mode 100644 index de7a08ed6..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_fragments.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "data": { - "people": [ - { - "address": { - "city": "London" - } - }, - { - "address": { - "city": "Albuquerque" - } - }, - { - "address": { - "city": "Hogwarts" - } - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json b/ballerina-tests/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json deleted file mode 100644 index c53aad7c9..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_fragments_querying_service_objects_with_multiple_fields.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "teacher": { - "name": "Walter White", - "subject": "Chemistry" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json b/ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json deleted file mode 100644 index fa34a4c81..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_1.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "errors": [ - { - "message": "prices: In element #0: In element #2:Float cannot represent non Float value: d", - "locations": [ - { - "line": 2, - "column": 30 - } - ] - }, - { - "message": "prices: In element #1: In element #3:Float cannot represent non Float value: is", - "locations": [ - { - "line": 2, - "column": 44 - } - ] - }, - { - "message": "prices: In element #2: In element #4:Float cannot represent non Float value: true", - "locations": [ - { - "line": 2, - "column": 65 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json b/ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json deleted file mode 100644 index 01b664a73..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_list_input_with_invalid_values_2.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "errors": [ - { - "message": "prices: In element #0:[Float!]! cannot represent non [Float!]! value: 2", - "locations": [ - { - "line": 2, - "column": 24 - } - ] - }, - { - "message": "prices: In element #1:[Float!]! cannot represent non [Float!]! value: 3", - "locations": [ - { - "line": 2, - "column": 27 - } - ] - }, - { - "message": "prices: In element #2:[Float!]! cannot represent non [Float!]! value: 4", - "locations": [ - { - "line": 2, - "column": 30 - } - ] - }, - { - "message": "prices: In element #3:[Float!]! cannot represent non [Float!]! value: 5", - "locations": [ - { - "line": 2, - "column": 33 - } - ] - }, - { - "message": "prices: In element #4:[Float!]! cannot represent non [Float!]! value: 6", - "locations": [ - { - "line": 2, - "column": 36 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_map.json b/ballerina-tests/tests/resources/expected_results/nested_map.json deleted file mode 100644 index d23dd4548..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_map.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "company": { - "workers": { - "contacts": { - "number": "+94771234567" - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_map_without_key_input.json b/ballerina-tests/tests/resources/expected_results/nested_map_without_key_input.json deleted file mode 100644 index 89ad14860..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_map_without_key_input.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"contacts\" argument \"key\" of type \"String!\" is required, but it was not provided.", - "locations": [ - { - "line": 4, - "column": 13 - } - ] - }, - { - "message": "Field \"contacts\" of type \"Contact!\" must have a selection of subfields. Did you mean \"contacts { ... }\"?", - "locations": [ - { - "line": 4, - "column": 13 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/nested_records_array.json b/ballerina-tests/tests/resources/expected_results/nested_records_array.json deleted file mode 100644 index b2774243d..000000000 --- a/ballerina-tests/tests/resources/expected_results/nested_records_array.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "data": { - "students": [ - { - "name": "John Doe", - "courses": [ - { - "name": "Electronics", - "books": [ - { - "name": "The Art of Electronics" - }, - { - "name": "Practical Electronics" - } - ] - }, - { - "name": "Computer Science", - "books": [ - { - "name": "Algorithms to Live By" - }, - { - "name": "Code: The Hidden Language" - } - ] - } - ] - }, - { - "name": "Jane Doe", - "courses": [ - { - "name": "Computer Science", - "books": [ - { - "name": "Algorithms to Live By" - }, - { - "name": "Code: The Hidden Language" - } - ] - }, - { - "name": "Mathematics", - "books": [ - { - "name": "Calculus Made Easy" - }, - { - "name": "Calculus" - } - ] - } - ] - }, - { - "name": "Jonny Doe", - "courses": [ - { - "name": "Electronics", - "books": [ - { - "name": "The Art of Electronics" - }, - { - "name": "Practical Electronics" - } - ] - }, - { - "name": "Computer Science", - "books": [ - { - "name": "Algorithms to Live By" - }, - { - "name": "Code: The Hidden Language" - } - ] - }, - { - "name": "Mathematics", - "books": [ - { - "name": "Calculus Made Easy" - }, - { - "name": "Calculus" - } - ] - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_list.json b/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_list.json deleted file mode 100644 index 95f8b9694..000000000 --- a/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_list.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "cities": ["Albequerque", "Hogwarts"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record.json b/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record.json deleted file mode 100644 index 30a4ee375..000000000 --- a/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "city": "Albequerque" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record_field.json b/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record_field.json deleted file mode 100644 index adeee9754..000000000 --- a/ballerina-tests/tests/resources/expected_results/non_null_input_for_nullable_record_field.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "accountNumber": 123456 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json b/ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json deleted file mode 100644 index 6c7d1267b..000000000 --- a/ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Harry Potter and the Sorcerer's Stone", - "director": "Chris Columbus" - }, - { - "movieName": "Sherlock Holmes", - "director": "Dexter Fletcher" - }, - { - "movieName": "El Camino", - "director": "Vince Gilligan" - }, - { - "movieName": "Escape Plan", - "director": "Mikael Hafstrom" - }, - { - "movieName": "Papillon", - "director": "Franklin Schaffner" - }, - { - "movieName": "The Fugitive", - "director": "Andrew Davis" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json b/ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json deleted file mode 100644 index 6c7d1267b..000000000 --- a/ballerina-tests/tests/resources/expected_results/non_null_list_type_variable_with_empty_list_value_2.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Harry Potter and the Sorcerer's Stone", - "director": "Chris Columbus" - }, - { - "movieName": "Sherlock Holmes", - "director": "Dexter Fletcher" - }, - { - "movieName": "El Camino", - "director": "Vince Gilligan" - }, - { - "movieName": "Escape Plan", - "director": "Mikael Hafstrom" - }, - { - "movieName": "Papillon", - "director": "Franklin Schaffner" - }, - { - "movieName": "The Fugitive", - "director": "Andrew Davis" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json b/ballerina-tests/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/non_null_type_variables_with_nullable_rgument.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_as_enum_input.json b/ballerina-tests/tests/resources/expected_results/null_as_enum_input.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_as_enum_input.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_as_enum_input_with_variable_value.json b/ballerina-tests/tests/resources/expected_results/null_as_enum_input_with_variable_value.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_as_enum_input_with_variable_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_as_resource_function_name.json b/ballerina-tests/tests/resources/expected_results/null_as_resource_function_name.json deleted file mode 100644 index e1c4adafe..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_as_resource_function_name.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "null": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_as_scalar_input.json b/ballerina-tests/tests/resources/expected_results/null_as_scalar_input.json deleted file mode 100644 index ebc4942d8..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_as_scalar_input.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "profile": { - "name": "Sherlock Holmes" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json b/ballerina-tests/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json deleted file mode 100644 index ebc4942d8..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_as_scalar_input_with_variable_value.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "profile": { - "name": "Sherlock Holmes" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_input_for_nullable_record_field.json b/ballerina-tests/tests/resources/expected_results/null_input_for_nullable_record_field.json deleted file mode 100644 index adeee9754..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_input_for_nullable_record_field.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "accountNumber": 123456 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments.json b/ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments.json deleted file mode 100644 index ebc4942d8..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "profile": { - "name": "Sherlock Holmes" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json b/ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json deleted file mode 100644 index ebc4942d8..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_defaultable_arguments_with_variable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "profile": { - "name": "Sherlock Holmes" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument.json b/ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument.json deleted file mode 100644 index 9d4a4589b..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Expected value of type \"String!\", found null.", - "locations": [ - { - "line": 2, - "column": 17 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json b/ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json deleted file mode 100644 index bdff44661..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_non_null_argument_with_variable_value.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Variable name expected value of type \"String!\", found null", - "locations": [ - { - "line": 2, - "column": 18 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json b/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json deleted file mode 100644 index 99467a2bb..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_error_added_to_context.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Data not found", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["name"] - } - ], - "data" : { - "name" : null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json b/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json deleted file mode 100644 index 5f204f8e4..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_input_object_with_variable_value.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "book": { - "name": "Algorithms to Live By" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json b/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json deleted file mode 100644 index bea3e50e1..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_for_nullable_list_type_input_with_variables.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Word list is empty" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field.json b/ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field.json deleted file mode 100644 index f9c107107..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "book": { - "name": "The Art of Electronics" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json b/ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json deleted file mode 100644 index f9c107107..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_in_input_object_field_with_variable_value.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "book": { - "name": "The Art of Electronics" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json b/ballerina-tests/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json deleted file mode 100644 index 64755bbee..000000000 --- a/ballerina-tests/tests/resources/expected_results/null_value_in_list_type_input_with_variables.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Hello! GraphQL" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_list.json b/ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_list.json deleted file mode 100644 index a58880a46..000000000 --- a/ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_list.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "cities": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_record.json b/ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_record.json deleted file mode 100644 index 6228e6dba..000000000 --- a/ballerina-tests/tests/resources/expected_results/nullable_input_for_nullable_record.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "city": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json b/ballerina-tests/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json deleted file mode 100644 index 91aa812d7..000000000 --- a/ballerina-tests/tests/resources/expected_results/nullable_list_type_input_with_invalid_value.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "errors": [ - { - "message": "words: In element #1:String cannot represent non String value: 5", - "locations": [ - { - "line": 2, - "column": 30 - } - ] - }, - { - "message": "words: In element #2:String cannot represent non String value: true", - "locations": [ - { - "line": 2, - "column": 33 - } - ] - }, - { - "message": "words: In element #3:String cannot represent non String value: {}", - "locations": [ - { - "line": 2, - "column": 39 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/nullable_list_type_input_without_value.json b/ballerina-tests/tests/resources/expected_results/nullable_list_type_input_without_value.json deleted file mode 100644 index 974f37339..000000000 --- a/ballerina-tests/tests/resources/expected_results/nullable_list_type_input_without_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "concat": "Word list is empty" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json b/ballerina-tests/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json deleted file mode 100644 index 1e9eea474..000000000 --- a/ballerina-tests/tests/resources/expected_results/nullable_union_of_distinct_services_array_query_on_selected_types.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "services": [ - {}, - { - "name": "Walter White" - }, - null - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/nullable_variables_without_value.json b/ballerina-tests/tests/resources/expected_results/nullable_variables_without_value.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/nullable_variables_without_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/optional_arrays_with_invalid_query.json b/ballerina-tests/tests/resources/expected_results/optional_arrays_with_invalid_query.json deleted file mode 100644 index 4df0c395f..000000000 --- a/ballerina-tests/tests/resources/expected_results/optional_arrays_with_invalid_query.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"searchVehicles\" of type \"[Vehicle!]\" must have a selection of subfields. Did you mean \"searchVehicles { ... }\"?", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/optional_enum_argument_with_value.json b/ballerina-tests/tests/resources/expected_results/optional_enum_argument_with_value.json deleted file mode 100644 index d12cf6dcc..000000000 --- a/ballerina-tests/tests/resources/expected_results/optional_enum_argument_with_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/optional_enum_argument_without_value.json b/ballerina-tests/tests/resources/expected_results/optional_enum_argument_without_value.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/optional_enum_argument_without_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter.json b/ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter.json deleted file mode 100644 index e21a693bd..000000000 --- a/ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "profile": { - "name": "Walter White", - "age": 52 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter_reference.json b/ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter_reference.json deleted file mode 100644 index 1b32113c1..000000000 --- a/ballerina-tests/tests/resources/expected_results/output_with_intersection_paramenter_reference.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "book": { - "name": "Nineteen Eighty-Four", - "author": "George Orwell" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_array.json b/ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_array.json deleted file mode 100644 index 56c9def77..000000000 --- a/ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_array.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "profiles": [ - { - "name": "Walter White", - "age": 52 - }, - { - "name": "Jesse Pinkman", - "age": 25 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json b/ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json deleted file mode 100644 index 498974b2c..000000000 --- a/ballerina-tests/tests/resources/expected_results/output_with_intersection_parameter_reference_array.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "books": [ - { - "name": "Nineteen Eighty-Four", - "author": "George Orwell" - }, - { - "name": "The Magic of Reality", - "author": "Richard Dawkins" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/quering_sdl_on_subgraph.json b/ballerina-tests/tests/resources/expected_results/quering_sdl_on_subgraph.json deleted file mode 100644 index 010306e74..000000000 --- a/ballerina-tests/tests/resources/expected_results/quering_sdl_on_subgraph.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "_service": { - "sdl": "extend schema @link(url: \"https://specs.apollo.dev/federation/v2.0\", import: [\"@key\" ,\"FieldSet\"]) \n\ndirective @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT|INTERFACE\n\ndirective @link(url: String!, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA\n\ntype Query {\n greet: String!\n _service: _Service!\n _entities(representations: [_Any!]!): [_Entity]!\n}\n\ntype ProductData @key(fields: \"id\") {\n id: String!\n reviews: [ReviewData!]!\n}\n\ntype ReviewData {\n id: String!\n}\n\ntype Moon @key(fields: \"name\", resolvable: false) {\n name: String!\n}\n\ntype Star @key(fields: \"name\") {\n name: String!\n constellation: String!\n designation: String!\n}\n\ntype Satellite @key(fields: \"name\") {\n name: String!\n MissionDuration: Int!\n}\n\ntype Planet @key(fields: \"name\") @key(fields: \"id\") {\n id: Int!\n name: String!\n mass: Decimal!\n numberOfMoons: Int!\n moon: Moon\n}\n\n\"The `Decimal` type corresponds to a subset of IEEE 754-2008 128-bit decimal (radix 10) floating point numbers\"\nscalar Decimal\n\nscalar _Any\n\nscalar FieldSet\n\nscalar link__Import\n\nenum link__Purpose {\n \"`EXECUTION` features provide metadata necessary for operation execution.\"\n EXECUTION\n \"`SECURITY` features provide metadata necessary to securely resolve fields.\"\n SECURITY\n}\n\ntype _Service {\n sdl: String!\n}\n\nunion _Entity = ProductData|Moon|Star|Satellite|Planet" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/query_type_introspection.json b/ballerina-tests/tests/resources/expected_results/query_type_introspection.json deleted file mode 100644 index e7b3219dc..000000000 --- a/ballerina-tests/tests/resources/expected_results/query_type_introspection.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "kind": "OBJECT", - "fields": [ - { - "name": "detective" - }, - { - "name": "teacher" - }, - { - "name": "student" - }, - { - "name": "profile" - }, - { - "name": "people" - }, - { - "name": "students" - } - ] - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/query_with_default_parameter.json b/ballerina-tests/tests/resources/expected_results/query_with_default_parameter.json deleted file mode 100644 index 34f3c9f21..000000000 --- a/ballerina-tests/tests/resources/expected_results/query_with_default_parameter.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "quoteById": "I can make them hurt if I want to!" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/query_without_default_parameter.json b/ballerina-tests/tests/resources/expected_results/query_without_default_parameter.json deleted file mode 100644 index 68463c911..000000000 --- a/ballerina-tests/tests/resources/expected_results/query_without_default_parameter.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "quoteById": "I am a high-functioning sociapath!" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/querying_subfields_on_type_name.json b/ballerina-tests/tests/resources/expected_results/querying_subfields_on_type_name.json deleted file mode 100644 index efb8dc4ed..000000000 --- a/ballerina-tests/tests/resources/expected_results/querying_subfields_on_type_name.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"__typename\" must not have a selection since type \"String!\" has no subfields.", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/querying_table_without_selections.json b/ballerina-tests/tests/resources/expected_results/querying_table_without_selections.json deleted file mode 100644 index 3fc31f3cb..000000000 --- a/ballerina-tests/tests/resources/expected_results/querying_table_without_selections.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"employees\" of type \"[Employee!]\" must have a selection of subfields. Did you mean \"employees { ... }\"?", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/record_type_arrays.json b/ballerina-tests/tests/resources/expected_results/record_type_arrays.json deleted file mode 100644 index 6210872cd..000000000 --- a/ballerina-tests/tests/resources/expected_results/record_type_arrays.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "data": { - "people": [ - { - "name": "Sherlock Holmes", - "address": { - "city": "London" - } - }, - { - "name": "Walter White", - "address": { - "city": "Albuquerque" - } - }, - { - "name": "Tom Marvolo Riddle", - "address": { - "city": "Hogwarts" - } - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/request_invalid_field.json b/ballerina-tests/tests/resources/expected_results/request_invalid_field.json deleted file mode 100644 index f3ddc56c3..000000000 --- a/ballerina-tests/tests/resources/expected_results/request_invalid_field.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"status\" on type \"Person\".", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/request_invalid_field_from_service_objects.json b/ballerina-tests/tests/resources/expected_results/request_invalid_field_from_service_objects.json deleted file mode 100644 index 62a8fff38..000000000 --- a/ballerina-tests/tests/resources/expected_results/request_invalid_field_from_service_objects.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"invalid\" on type \"Lift\".", - "locations": [ - { - "line": 5, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/requesting_object_without_fields.json b/ballerina-tests/tests/resources/expected_results/requesting_object_without_fields.json deleted file mode 100644 index ee68c355c..000000000 --- a/ballerina-tests/tests/resources/expected_results/requesting_object_without_fields.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"profile\" of type \"Person!\" must have a selection of subfields. Did you mean \"profile { ... }\"?", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/resolver_returnig_error_for_invalid_entity.json b/ballerina-tests/tests/resources/expected_results/resolver_returnig_error_for_invalid_entity.json deleted file mode 100644 index fddc4d275..000000000 --- a/ballerina-tests/tests/resources/expected_results/resolver_returnig_error_for_invalid_entity.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "errors": [ - { - "message": "No entities found for {__typename: 'Invalid'}", - "locations": [ - { - "line": 1, - "column": 3 - } - ], - "path": [ - "_entities", - 0 - ] - } - ], - "data": { - "_entities": [ - null - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json b/ballerina-tests/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json deleted file mode 100644 index 961b0fd83..000000000 --- a/ballerina-tests/tests/resources/expected_results/resolver_returning_list_of_nested_service_objects.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "data": { - "top3": [ - { - "product": { - "id": "1" - }, - "score": 20 - }, - { - "product": { - "id": "2" - }, - "score": 20 - }, - { - "product": { - "id": "3" - }, - "score": 20 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resolver_returning_map_of_service_objects.json b/ballerina-tests/tests/resources/expected_results/resolver_returning_map_of_service_objects.json deleted file mode 100644 index f55358abf..000000000 --- a/ballerina-tests/tests/resources/expected_results/resolver_returning_map_of_service_objects.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "account": { - "details": { - "name": "James" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json b/ballerina-tests/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json deleted file mode 100644 index ba5e22500..000000000 --- a/ballerina-tests/tests/resources/expected_results/resolver_returning_table_of_nested_service_objects.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "data": { - "all": [ - { - "product": { - "id": "1" - }, - "score": 20 - }, - { - "product": { - "id": "2" - }, - "score": 20 - }, - { - "product": { - "id": "3" - }, - "score": 20 - }, - { - "product": { - "id": "4" - }, - "score": 20 - }, - { - "product": { - "id": "5" - }, - "score": 20 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resolver_returning_tables.json b/ballerina-tests/tests/resources/expected_results/resolver_returning_tables.json deleted file mode 100644 index 5f65846f7..000000000 --- a/ballerina-tests/tests/resources/expected_results/resolver_returning_tables.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "all": [ - { - "isoCode": "AFG" - }, - { - "isoCode": "SL" - }, - { - "isoCode": "US" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resolver_returning_tables_with_errors.json b/ballerina-tests/tests/resources/expected_results/resolver_returning_tables_with_errors.json deleted file mode 100644 index a39f4f52c..000000000 --- a/ballerina-tests/tests/resources/expected_results/resolver_returning_tables_with_errors.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "errors": [ - { - "message": "Undefined task!", - "locations": [ - { - "line": 3, - "column": 9 - } - ], - "path": [ - "tasks", - "subTasks", - 1 - ] - } - ], - "data": { - "tasks": [ - { - "subTasks": null - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resource_interceptors.json b/ballerina-tests/tests/resources/expected_results/resource_interceptors.json deleted file mode 100644 index b9f966d0f..000000000 --- a/ballerina-tests/tests/resources/expected_results/resource_interceptors.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "errors": [ - { - "message": "Access denied!", - "locations": [ - { - "line": 11, - "column": 5 - } - ], - "path": [ - "newPerson" - ] - } - ], - "data": { - "customer": { - "id": 4, - "name": null, - "address": { - "number": 227, - "street": "Street 3", - "city": "New York" - } - }, - "newPerson": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resource_returning_arrays_missing_fields.json b/ballerina-tests/tests/resources/expected_results/resource_returning_arrays_missing_fields.json deleted file mode 100644 index 3b21e7dd1..000000000 --- a/ballerina-tests/tests/resources/expected_results/resource_returning_arrays_missing_fields.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"people\" of type \"[Person!]!\" must have a selection of subfields. Did you mean \"people { ... }\"?", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} - \ No newline at end of file diff --git a/ballerina-tests/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json b/ballerina-tests/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json deleted file mode 100644 index ee4a7e170..000000000 --- a/ballerina-tests/tests/resources/expected_results/resource_returning_optional_service_object_arrays.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "searchVehicles": [ - { - "id": "V1" - }, - { - "id": "V2" - }, - { - "id": "V3" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resource_returning_service_object.json b/ballerina-tests/tests/resources/expected_results/resource_returning_service_object.json deleted file mode 100644 index 2552ad76b..000000000 --- a/ballerina-tests/tests/resources/expected_results/resource_returning_service_object.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "greet": { - "generalGreeting": "Hello, world" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resource_returning_service_object_array.json b/ballerina-tests/tests/resources/expected_results/resource_returning_service_object_array.json deleted file mode 100644 index 8894a62c2..000000000 --- a/ballerina-tests/tests/resources/expected_results/resource_returning_service_object_array.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "allVehicles": [ - { - "name": "Benz" - }, - { - "name": "BMW" - }, - { - "name": "Ford" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/resource_returning_tables.json b/ballerina-tests/tests/resources/expected_results/resource_returning_tables.json deleted file mode 100644 index 2ac2695f5..000000000 --- a/ballerina-tests/tests/resources/expected_results/resource_returning_tables.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "employees": [ - { - "name": "John Doe" - }, - { - "name": "Jane Doe" - }, - { - "name": "Johnny Roe" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/returning_enum_array.json b/ballerina-tests/tests/resources/expected_results/returning_enum_array.json deleted file mode 100644 index 28eb9c829..000000000 --- a/ballerina-tests/tests/resources/expected_results/returning_enum_array.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "holidays": [ - "SATURDAY", - "SUNDAY" - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/returning_enum_array_with_errors.json b/ballerina-tests/tests/resources/expected_results/returning_enum_array_with_errors.json deleted file mode 100644 index 55263a736..000000000 --- a/ballerina-tests/tests/resources/expected_results/returning_enum_array_with_errors.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "errors": [ - { - "message": "Holiday!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["openingDays", 2] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json b/ballerina-tests/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json deleted file mode 100644 index 929583c0e..000000000 --- a/ballerina-tests/tests/resources/expected_results/returning_nullable_enum_array_with_errors.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Holiday!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["specialHolidays", 1] - } - ], - "data": { - "specialHolidays": ["TUESDAY", null, "THURSDAY"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/returning_recursive_service_type.json b/ballerina-tests/tests/resources/expected_results/returning_recursive_service_type.json deleted file mode 100644 index a6498af86..000000000 --- a/ballerina-tests/tests/resources/expected_results/returning_recursive_service_type.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "trail": { - "name": "Blue Bird" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/returning_union_of_service_objects.json b/ballerina-tests/tests/resources/expected_results/returning_union_of_service_objects.json deleted file mode 100644 index 0d8fc4c39..000000000 --- a/ballerina-tests/tests/resources/expected_results/returning_union_of_service_objects.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "search": [ - { - "name": "Blue Bird" - }, - { - "name": "Blackhawk" - }, - { - "name": "Astra Express" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias.json b/ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias.json deleted file mode 100644 index 69e2b8382..000000000 --- a/ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "sherlock": { - "name": "Sherlock Holmes", - "residence": { - "hometown": "London" - } - }, - "walter": { - "name": "Walter White", - "residence": { - "hometown": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json b/ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json deleted file mode 100644 index b35b19ed7..000000000 --- a/ballerina-tests/tests/resources/expected_results/same_field_with_multiple_alias_different_subfields.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "sherlock": { - "name": "Sherlock Holmes", - "residence": { - "apartment": "221/B" - } - }, - "walter": { - "name": "Walter White", - "residence": { - "hometown": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/scalar_arrays.json b/ballerina-tests/tests/resources/expected_results/scalar_arrays.json deleted file mode 100644 index 623dce962..000000000 --- a/ballerina-tests/tests/resources/expected_results/scalar_arrays.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "ids": [0, 1, 2] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/scalar_arrays_with_errors.json b/ballerina-tests/tests/resources/expected_results/scalar_arrays_with_errors.json deleted file mode 100644 index 250a62d22..000000000 --- a/ballerina-tests/tests/resources/expected_results/scalar_arrays_with_errors.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "errors": [ - { - "message": "Not Found!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["idsWithErrors", 3] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json b/ballerina-tests/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json deleted file mode 100644 index 000e84c10..000000000 --- a/ballerina-tests/tests/resources/expected_results/scalar_nullable_arrays_with_errors.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Not Found!", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["friends", 2] - } - ], - "data": { - "friends": ["walter", "jessie", null] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_1.json deleted file mode 100644 index ef576d03a..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "greet": "Hello, Walter White", - "name": "Walter White" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_10.json b/ballerina-tests/tests/resources/expected_results/server_cache_10.json deleted file mode 100644 index 0a02fb9b9..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_10.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "updateName": "Heisenberg" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_2.json deleted file mode 100644 index bfb6f958d..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "updateName": "John" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_3.json deleted file mode 100644 index c62c98315..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_3.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "greet": "Hello, John", - "name": "Walter White" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_4.json deleted file mode 100644 index 6168dc09b..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_4.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "greet": "Hello, John", - "name": "John" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_5.json deleted file mode 100644 index e710a09f1..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_5.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "updateName": "Walter White" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_6.json b/ballerina-tests/tests/resources/expected_results/server_cache_6.json deleted file mode 100644 index deddf6613..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_6.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "addFriend": { - "name": "Badger", - "age": 26, - "isMarried": false - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_7.json b/ballerina-tests/tests/resources/expected_results/server_cache_7.json deleted file mode 100644 index 89ee82e65..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_7.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "addFriend": { - "name": "Pete", - "age": 27, - "isMarried": false - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_8.json b/ballerina-tests/tests/resources/expected_results/server_cache_8.json deleted file mode 100644 index 679b9418f..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_8.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "addFriend": { - "name": "Gretchen Schwartz", - "age": 50, - "isMarried": true - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_9.json b/ballerina-tests/tests/resources/expected_results/server_cache_9.json deleted file mode 100644 index f21f624b6..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_9.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "greet": "Hello, Heisenberg", - "name": "Heisenberg" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json deleted file mode 100644 index 843b98e6c..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "friend": "Harry" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json deleted file mode 100644 index 98ca7e850..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "updateFriend": "Potter" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json deleted file mode 100644 index 016420f29..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_TTL_3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "friend": "Potter" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json deleted file mode 100644 index cd3c7569e..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isAllMarried": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json deleted file mode 100644 index 952e90639..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "updateEnemy": { - "name": "Enemy3", - "isMarried": true - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json deleted file mode 100644 index cd225b367..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_list_inputs_3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isAllMarried": true - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json deleted file mode 100644 index 5d89b1b20..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_1.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "enemies": [ - { - "name": "Enemy2", - "isMarried": true - }, - { - "name": "Enemy3", - "isMarried": false - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json deleted file mode 100644 index c921f0f4b..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "removeEnemy": { - "name": "Enemy2", - "isMarried": true - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json deleted file mode 100644 index 5d89b1b20..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_eviction_with_nullable_inputs_3.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "enemies": [ - { - "name": "Enemy2", - "isMarried": true - }, - { - "name": "Enemy3", - "isMarried": false - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_operation_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_operation_1.json deleted file mode 100644 index 6a4ee8a63..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_operation_1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "greet": "Hello, Walter White", - "name": "Walter White" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json deleted file mode 100644 index ccc31cb20..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_1.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "profiles": [ - { - "name": "John" - }, - { - "name": "Doe" - }, - { - "name": "Jane" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json deleted file mode 100644 index 8a8e3b51c..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_2.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "profiles": [ - { - "name": "John", - "age": 30 - }, - { - "name": "Doe", - "age": 25 - }, - { - "name": "Jane", - "age": 35 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json deleted file mode 100644 index 5afdfa2eb..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_records_with_non_optional_fields_3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "profiles": [] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_1.json deleted file mode 100644 index 4d8b6eccd..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_1.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 57 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "John", - "age": 30 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_2.json deleted file mode 100644 index 20470abc1..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "updateFriend": { - "name": "Tyler", - "age": 28 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_3.json deleted file mode 100644 index 4d8b6eccd..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_3.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 57 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "John", - "age": 30 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_4.json deleted file mode 100644 index c82e664c6..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_4.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 57 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "John", - "age": 30 - }, - { - "name": "Tyler", - "age": 28 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_5.json deleted file mode 100644 index e4612f090..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_5.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 25 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "Elliott Schwartz", - "age": 51 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_6.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_6.json deleted file mode 100644 index 2002f9872..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_6.json +++ /dev/null @@ -1,27 +0,0 @@ - -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 25 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "Elliott Schwartz", - "age": 51 - }, - { - "name": "Tyler", - "age": 28 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_7.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_7.json deleted file mode 100644 index e4612f090..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_arrays_7.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 25 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "Elliott Schwartz", - "age": 51 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_1.json deleted file mode 100644 index 12e747142..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_1.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "data": { - "authors": [ - { - "name": "Author 1", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - { - "name": "Author 2", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - }, - { - "name": "Author 3", - "books": [ - { - "id": 6, - "title": "Book 6" - }, - { - "id": 7, - "title": "Book 7" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_2.json deleted file mode 100644 index cf94e5453..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_2.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "data": { - "sabthar": { - "name": "Sabthar", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - "mahroof": { - "name": "Mahroof", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_3.json deleted file mode 100644 index 1ea495104..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_3.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "data": { - "authors": [ - { - "name": "Sabthar", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - { - "name": "Mahroof", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - }, - { - "name": "Author 3", - "books": [ - { - "id": 6, - "title": "Book 6" - }, - { - "id": 7, - "title": "Book 7" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_4.json deleted file mode 100644 index 1d9976f5d..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_4.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "data": { - "authors": [ - { - "name": "Yual Noah Harari", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - { - "name": "Mark Manson", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - }, - { - "name": "Author 3", - "books": [ - { - "id": 6, - "title": "Book 6" - }, - { - "id": 7, - "title": "Book 7" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_5.json deleted file mode 100644 index c0bd69bf7..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dataloader_5.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "data": { - "harari": { - "name": "Yual Noah Harari", - "books": [ - { - "id": 1, - "title": "Book 1" - }, - { - "id": 2, - "title": "Book 2" - }, - { - "id": 3, - "title": "Book 3" - } - ] - }, - "manson": { - "name": "Mark Manson", - "books": [ - { - "id": 4, - "title": "Book 4" - }, - { - "id": 5, - "title": "Book 5" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json deleted file mode 100644 index 2b2795e33..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "user": { - "id": 1 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json deleted file mode 100644 index 11f024125..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "user": { - "id": 1, - "name": "John" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json deleted file mode 100644 index 2b351b638..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_3.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "user": { - "id": 1, - "name": "John", - "age": 25 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json deleted file mode 100644 index 466e196a7..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_4.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "updateUser": { - "id": 1, - "name": "White", - "age": 45 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json deleted file mode 100644 index 2100dc760..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_5.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "user": { - "id": 1, - "name": "White", - "age": 45 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json deleted file mode 100644 index ecb46c363..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_6.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "user": { - "id": 1, - "name": "White" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json deleted file mode 100644 index 1dc51f786..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_7.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "updateUser": { - "id": 1, - "name": "Walter", - "age": 45 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json deleted file mode 100644 index b6dca40cd..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_dynamic_responses_8.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "user": { - "id": 1, - "name": "Walter" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_1.json deleted file mode 100644 index de2cc3a4e..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "status": ["dead", "alive"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_2.json deleted file mode 100644 index 962799bbd..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_empty_input_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "status": [] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_1.json deleted file mode 100644 index 1ff6f8f35..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_1.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Invalid argument type", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": [ - "isAdult" - ] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_2.json deleted file mode 100644 index 692ac9148..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isAdult": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_3.json deleted file mode 100644 index 1d6dd877f..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "getFriendService": { - "name": "Lalo Salamanca", - "age": 44 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_4.json deleted file mode 100644 index 2a7a05b12..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_4.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "errors":[ - { - "message":"No person found with the name: Lalo Salamanca", - "locations":[ - { - "line":2, - "column":5 - } - ], - "path": ["getFriendService"] - } - ], - "data": null -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_5.json deleted file mode 100644 index 566f6b3d7..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_errors_5.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "addFriend": { - "name": "Lalo Salamanca", - "age": 44 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_1.json deleted file mode 100644 index 45ebc9d1e..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "searchEnemy": { - "name": "Enemy6", - "age": 12 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_2.json deleted file mode 100644 index 8d7496a71..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "removeEnemy": { - "name": "Enemy6" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_3.json deleted file mode 100644 index 45ebc9d1e..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_input_object_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "searchEnemy": { - "name": "Enemy6", - "age": 12 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_1.json deleted file mode 100644 index 9c6746a94..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "enemy": "Tom Marvolo Riddle - voldemort" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_2.json deleted file mode 100644 index e7c68ef92..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "updateEnemy": "Snape" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_3.json deleted file mode 100644 index 211a99c20..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_interceptors_3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "enemy": "Tom Marvolo Riddle - Snape" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_1.json deleted file mode 100644 index 2f249f85e..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_1.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "users1": [ - { - "id": 1, - "name": "John", - "age": 25 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_2.json deleted file mode 100644 index 82a3bcd9d..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "users1": [ - { - "id": 2, - "name": "Jessie", - "age": 17 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_3.json deleted file mode 100644 index 3b3522d6c..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_3.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "updateUser": { - "id": 1, - "name": "Shane", - "age": 30 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_4.json deleted file mode 100644 index 8e305a43a..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_4.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "users2": [ - { - "id": 1, - "name": "Shane", - "age": 30 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_5.json deleted file mode 100644 index 33c8fefcf..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_5.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "updateUser": { - "id": 1, - "name": "Rock", - "age": 22 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_6.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_6.json deleted file mode 100644 index a6b6a8709..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_6.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "users2": [ - { - "id": 1, - "name": "Rock", - "age": 22 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_7.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_7.json deleted file mode 100644 index d555b8602..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_7.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "cities": ["London"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_8.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_8.json deleted file mode 100644 index 0bc609d40..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_list_input_8.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "cities": ["London", "london"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_1.json deleted file mode 100644 index c910c4822..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "searchEnemy": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_2.json deleted file mode 100644 index 813367d60..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "addEnemy2": { - "name": "Enemy6" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_3.json deleted file mode 100644 index 45ebc9d1e..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_null_values_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "searchEnemy": { - "name": "Enemy6", - "age": 12 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json deleted file mode 100644 index cf8598900..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_1.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "enemies": [ - { - "name": "Enemy1", - "isMarried": false - }, - { - "name": "Enemy2", - "isMarried": true - }, - { - "name": "Enemy3", - "isMarried": false - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json deleted file mode 100644 index 4e92a3a0f..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "removeEnemy": { - "name": "Enemy1", - "isMarried": false - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_3.json deleted file mode 100644 index 5d89b1b20..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_3.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "enemies": [ - { - "name": "Enemy2", - "isMarried": true - }, - { - "name": "Enemy3", - "isMarried": false - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_4.json deleted file mode 100644 index c921f0f4b..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_4.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "removeEnemy": { - "name": "Enemy2", - "isMarried": true - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_5.json deleted file mode 100644 index 422c391d3..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_5.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "enemies": [ - { - "name": "Enemy3", - "isMarried": false - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_6.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_6.json deleted file mode 100644 index 6bd22b280..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_6.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "status": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json deleted file mode 100644 index 3d61acf9d..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_7.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "status": ["dead", "alive"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json deleted file mode 100644 index 4f69c64a6..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_nullable_inputs_8.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "status": ["alive", "alive"] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_1.json deleted file mode 100644 index c177d9d36..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "getFriendService": { - "age": 30 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_2.json deleted file mode 100644 index e6b5519ff..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "updateFriend": { - "age": 45 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_3.json deleted file mode 100644 index d38e33da6..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_partial_reponses_3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "getFriendService": { - "age": 45 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_1.json deleted file mode 100644 index 47e2c9b67..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_1.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "friends": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 57 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_2.json deleted file mode 100644 index 683b0567d..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "addFriend": { - "name": "John", - "age": 30 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_3.json deleted file mode 100644 index 9712c6d21..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "updateFriend": { - "name": "Walter White Jr.", - "age": 25 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_4.json deleted file mode 100644 index aea7d6176..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_4.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "friends": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 25 - }, - { - "name": "Elliott Schwartz", - "age": 51 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_5.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_5.json deleted file mode 100644 index 8a61e7e63..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_rec_5.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "addFriend": { - "name": "Elliott Schwartz", - "age": 51 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_1.json deleted file mode 100644 index 6a4380041..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "getFriendService": { - "name": "Jesse Pinkman", - "age": 23 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_2.json deleted file mode 100644 index d65b2a8b1..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "updateFriend": { - "name": "Jesse Pinkman", - "age": 30 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_3.json deleted file mode 100644 index d63882076..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_svc_obj_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "getFriendService": { - "name": "Jesse Pinkman", - "age": 30 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_1.json deleted file mode 100644 index fa3324751..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_1.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "data": { - "getAllFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 25 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "Elliott Schwartz", - "age": 51 - }, - { - "name": "Tyler", - "age": 28 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_2.json deleted file mode 100644 index c82e664c6..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_ttl_2.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "data": { - "getFriendServices": [ - { - "name": "Skyler", - "age": 45 - }, - { - "name": "Walter White Jr.", - "age": 57 - }, - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "John", - "age": 30 - }, - { - "name": "Tyler", - "age": 28 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_union_1.json deleted file mode 100644 index 2e45e8dbd..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "getServices": [ - { - "name": "Jesse Pinkman", - "age": 30 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_union_2.json deleted file mode 100644 index 205d7d0d1..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "addEnemy": { - "name": "Gandalf", - "age": 68 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_union_3.json deleted file mode 100644 index fa28ba6c2..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "addEnemy": { - "name": "Jake", - "age": 22 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_4.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_union_4.json deleted file mode 100644 index 202d1d960..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_union_4.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "getServices": [ - { - "name": "Jesse Pinkman", - "age": 30 - }, - { - "name": "Gandalf", - "age": 68 - }, - { - "name": "Jake", - "age": 22 - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_1.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_1.json deleted file mode 100644 index 966f09c7d..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_1.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "relationship": { - "name": "Gus Fring", - "status": "dead" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_2.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_2.json deleted file mode 100644 index f6e414bf5..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_2.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "updateAssociate": { - "name": "Gus Fring", - "status": "alive" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_3.json b/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_3.json deleted file mode 100644 index ee55131d8..000000000 --- a/ballerina-tests/tests/resources/expected_results/server_cache_with_unions_3.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "relationship": { - "name": "Gus Fring", - "status": "alive" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json b/ballerina-tests/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json deleted file mode 100644 index 5d3828361..000000000 --- a/ballerina-tests/tests/resources/expected_results/service_object_array_with_fragment_returning_error.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "errors": [ - { - "message": "Registered Year is Not Found", - "locations": [ - { - "line": 9, - "column": 5 - } - ], - "path": ["allVehicles", 2, "registeredYear"] - } - ], - "data": { - "allVehicles": [ - { - "name": "Benz", - "registeredYear": 2005 - }, - { - "name": "BMW", - "registeredYear": 2010 - }, - { - "name": "Ford", - "registeredYear": null - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/service_object_array_with_invalid_response_order.json b/ballerina-tests/tests/resources/expected_results/service_object_array_with_invalid_response_order.json deleted file mode 100644 index e490ab73e..000000000 --- a/ballerina-tests/tests/resources/expected_results/service_object_array_with_invalid_response_order.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "data": { - "allVehicles": [ - { - "name": "Benz", - "registeredYear": 2005 - }, - { - "name": "BMW", - "registeredYear": 2010 - }, - { - "name": "Ford", - "registeredYear": null - } - ] - }, - "errors": [ - { - "message": "Registered Year is Not Found", - "locations": [ - { - "line": 9, - "column": 5 - } - ], - "path": ["allVehicles", 2, "registeredYear"] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/service_object_defined_as_record_field.json b/ballerina-tests/tests/resources/expected_results/service_object_defined_as_record_field.json deleted file mode 100644 index 18b17dadf..000000000 --- a/ballerina-tests/tests/resources/expected_results/service_object_defined_as_record_field.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "latest": { - "product": { - "id": "5" - }, - "score": 20 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/service_with_other_annotations.json b/ballerina-tests/tests/resources/expected_results/service_with_other_annotations.json deleted file mode 100644 index c870e5b2c..000000000 --- a/ballerina-tests/tests/resources/expected_results/service_with_other_annotations.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "greeting": "Hello" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/subscription_invalid_field.json b/ballerina-tests/tests/resources/expected_results/subscription_invalid_field.json deleted file mode 100644 index 2d8e54add..000000000 --- a/ballerina-tests/tests/resources/expected_results/subscription_invalid_field.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"invalidField\" on type \"Subscription\".", - "locations": [ - { - "line": 1, - "column": 16 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_null_value.json b/ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_null_value.json deleted file mode 100644 index 0c585883f..000000000 --- a/ballerina-tests/tests/resources/expected_results/test_entities_resolver_returning_null_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "_entities": [null] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/test_quering_on_interface.json b/ballerina-tests/tests/resources/expected_results/test_quering_on_interface.json deleted file mode 100644 index b5133e882..000000000 --- a/ballerina-tests/tests/resources/expected_results/test_quering_on_interface.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "animal": { - "name": "WALTER", - "sex": "male" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json b/ballerina-tests/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json deleted file mode 100644 index afa855110..000000000 --- a/ballerina-tests/tests/resources/expected_results/test_querying_fragment_on_transitive_interface.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": { - "thisIsAMule": { - "name": "LARA", - "sex": "female", - "father": { - "__typename": "Donkey", - "name": "RUDY", - "id": 5 - }, - "isAggressive": false - }, - "thisIsAHorse": { - "name": "WALTER", - "sex": "male", - "father": { - "__typename": "Horse", - "name": "WALTER" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type.json b/ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type.json deleted file mode 100644 index a8ae5b7e6..000000000 --- a/ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "animal": { - "isAggressive": false - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json b/ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json deleted file mode 100644 index 93a80fc86..000000000 --- a/ballerina-tests/tests/resources/expected_results/test_querying_on_transitive_type_and_interface.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "animal": { - "name": "LARA", - "sex": "female", - "isAggressive": false - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json b/ballerina-tests/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json deleted file mode 100644 index 03d5c3e83..000000000 --- a/ballerina-tests/tests/resources/expected_results/test_reference_resolver_returning_record_with_object_fields.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "_entities": [ - { - "__typename": "ProductData", - "id": "1", - "reviews": [ - { - "id": "123" - } - ] - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_introspection.json b/ballerina-tests/tests/resources/expected_results/type_introspection.json deleted file mode 100644 index c1cf87a46..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_introspection.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": { - "__type": { - "kind": "OBJECT", - "fields": [ - { - "name": "name" - }, - { - "name": "age" - }, - { - "name": "address" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_introspection_in_invalid_place.json b/ballerina-tests/tests/resources/expected_results/type_introspection_in_invalid_place.json deleted file mode 100644 index 97041c985..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_introspection_in_invalid_place.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Cannot query field \"__type\" on type \"Person\".", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/type_introspection_on_non_existing_type.json b/ballerina-tests/tests/resources/expected_results/type_introspection_on_non_existing_type.json deleted file mode 100644 index c8ac900fc..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_introspection_on_non_existing_type.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "__type": null - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_introspection_with_alias.json b/ballerina-tests/tests/resources/expected_results/type_introspection_with_alias.json deleted file mode 100644 index 047bee823..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_introspection_with_alias.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "FieldType": { - "name": "__Field", - "kind": "OBJECT" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_introspection_without_fields.json b/ballerina-tests/tests/resources/expected_results/type_introspection_without_fields.json deleted file mode 100644 index a57bf3e49..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_introspection_without_fields.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"__type\" of type \"__Type\" must have a selection of subfields. Did you mean \"__type { ... }\"?", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/type_introspection_without_type_name_argument.json b/ballerina-tests/tests/resources/expected_results/type_introspection_without_type_name_argument.json deleted file mode 100644 index 11ed3564c..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_introspection_without_type_name_argument.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"__type\" argument \"name\" of type \"String!\" is required, but it was not provided.", - "locations": [ - { - "line": 2, - "column": 5 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_in_fragments.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_in_fragments.json deleted file mode 100644 index e7d7ffb7f..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_in_fragments.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "data": { - "search": [ - { - "__typename": "StudentService", - "name": "Jesse Pinkman" - }, - { - "subject": "Chemistry" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json deleted file mode 100644 index eb82d6109..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_nullable_union_of_service_types.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "services": [ - { - "__typename": "StudentService", - "name": "Jesse Pinkman" - }, - { - "__typename": "TeacherService", - "subject": "Chemistry" - }, - null - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_operation.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_operation.json deleted file mode 100644 index df10f86cb..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_operation.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "__typename": "Query" - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_record_types.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_record_types.json deleted file mode 100644 index 3e3f94e17..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_record_types.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "detective": { - "__typename": "Person" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_service_types.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_service_types.json deleted file mode 100644 index 0599bb86d..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_service_types.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "teacher": { - "name": "Walter White", - "__typename": "TeacherService" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_record_types.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_record_types.json deleted file mode 100644 index 695441abb..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_record_types.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "data": { - "learningSources": [ - { - "__typename": "Book", - "name": "The Art of Electronics" - }, - { - "__typename": "Book", - "name": "Practical Electronics" - }, - { - "__typename": "Book", - "name": "Algorithms to Live By" - }, - { - "__typename": "Book", - "name": "Code: The Hidden Language" - }, - { - "__typename": "Course" - }, - { - "__typename": "Course" - }, - { - "__typename": "Course" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json b/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json deleted file mode 100644 index ce435bcc7..000000000 --- a/ballerina-tests/tests/resources/expected_results/type_name_introspection_on_union_of_service_types.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": { - "search": [ - { - "__typename": "StudentService", - "name": "Jesse Pinkman" - }, - { - "__typename": "TeacherService", - "subject": "Chemistry" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_field.json b/ballerina-tests/tests/resources/expected_results/typename_introspection_on_field.json deleted file mode 100644 index ad2144508..000000000 --- a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_field.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "data": { - "__type": { - "name": "Person", - "fields": [ - { - "name": "name", - "__typename": "__Field" - }, - { - "name": "age", - "__typename": "__Field" - }, - { - "name": "address", - "__typename": "__Field" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_scalar.json b/ballerina-tests/tests/resources/expected_results/typename_introspection_on_scalar.json deleted file mode 100644 index 4118c2b26..000000000 --- a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_scalar.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Field \"name\" must not have a selection since type \"String!\" has no subfields.", - "locations": [ - { - "line": 3, - "column": 9 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_schema_introspection.json b/ballerina-tests/tests/resources/expected_results/typename_introspection_on_schema_introspection.json deleted file mode 100644 index 7fac212c0..000000000 --- a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_schema_introspection.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "__Field", - "__typename": "__Type" - }, - { - "name": "__TypeKind", - "__typename": "__Type" - }, - { - "name": "Query", - "__typename": "__Type" - }, - { - "name": "Address", - "__typename": "__Type" - }, - { - "name": "__Schema", - "__typename": "__Type" - }, - { - "name": "__Type", - "__typename": "__Type" - }, - { - "name": "__EnumValue", - "__typename": "__Type" - }, - { - "name": "__DirectiveLocation", - "__typename": "__Type" - }, - { - "name": "String", - "__typename": "__Type" - }, - { - "name": "Student", - "__typename": "__Type" - }, - { - "name": "Int", - "__typename": "__Type" - }, - { - "name": "Book", - "__typename": "__Type" - }, - { - "name": "__InputValue", - "__typename": "__Type" - }, - { - "name": "Course", - "__typename": "__Type" - }, - { - "name": "Boolean", - "__typename": "__Type" - }, - { - "name": "Person", - "__typename": "__Type" - }, - { - "name": "__Directive", - "__typename": "__Type" - } - ] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_type_record.json b/ballerina-tests/tests/resources/expected_results/typename_introspection_on_type_record.json deleted file mode 100644 index 9d9b9c4ae..000000000 --- a/ballerina-tests/tests/resources/expected_results/typename_introspection_on_type_record.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "__type": { - "__typename": "__Type" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/uerying_entities_field_with_object_variable.json b/ballerina-tests/tests/resources/expected_results/uerying_entities_field_with_object_variable.json deleted file mode 100644 index 43ea3d412..000000000 --- a/ballerina-tests/tests/resources/expected_results/uerying_entities_field_with_object_variable.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "errors": [ - { - "message": "[_Any!]! cannot represent non [_Any!]! value: {\"name\":\"Acamar\"}", - "locations": [{ "line": 2, "column": 31 }] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/union_of_distinct_service_objects.json b/ballerina-tests/tests/resources/expected_results/union_of_distinct_service_objects.json deleted file mode 100644 index 86dc7aeed..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_of_distinct_service_objects.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "profile": { - "name": "Walter White", - "subject": "Chemistry" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json b/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json deleted file mode 100644 index 0282a240c..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "search": [ - {}, - { - "name": "Walter White" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json b/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json deleted file mode 100644 index 0282a240c..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_array_query_on_selected_types_fragment_on_root.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "search": [ - {}, - { - "name": "Walter White" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json b/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json deleted file mode 100644 index a862bbc79..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_of_distinct_services_query_on_selected_types.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "profile": {} - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_type_names.json b/ballerina-tests/tests/resources/expected_results/union_type_names.json deleted file mode 100644 index f5b832a6a..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_type_names.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "data": { - "__schema": { - "queryType": { - "fields": [ - { - "name": "nonNullSingleObject", - "type": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": "PeopleService", - "kind": "UNION", - "ofType": null - } - } - }, - { - "name": "nullableSingleObject", - "type": { - "name": "PeopleService", - "kind": "UNION", - "ofType": null - } - }, - { - "name": "nonNullArray", - "type": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": null, - "kind": "LIST", - "ofType": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": "PeopleService", - "kind": "UNION" - } - } - } - } - }, - { - "name": "nullableArray", - "type": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": null, - "kind": "LIST", - "ofType": { - "name": "PeopleService", - "kind": "UNION", - "ofType": null - } - } - } - }, - { - "name": "nonNullUndefinedUnionType", - "type": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": "StudentService_TeacherService", - "kind": "UNION", - "ofType": null - } - } - }, - { - "name": "nonNullUndefinedUnionTypeArray", - "type": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": null, - "kind": "LIST", - "ofType": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": "StudentService_TeacherService", - "kind": "UNION" - } - } - } - } - }, - { - "name": "nullableUndefinedUnionType", - "type": { - "name": "StudentService_TeacherService", - "kind": "UNION", - "ofType": null - } - }, - { - "name": "nullableUndefinedUnionTypeArray", - "type": { - "name": null, - "kind": "NON_NULL", - "ofType": { - "name": null, - "kind": "LIST", - "ofType": { - "name": "StudentService_TeacherService", - "kind": "UNION", - "ofType": null - } - } - } - } - ] - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_types_with_field_returning_enum.json b/ballerina-tests/tests/resources/expected_results/union_types_with_field_returning_enum.json deleted file mode 100644 index c3364ffe6..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_types_with_field_returning_enum.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data":{ - "profile":{ - "name":"Walter White", - "holidays":["SATURDAY", "SUNDAY"] - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document.json b/ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document.json deleted file mode 100644 index c7bf9c49f..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "data": { - "learningSources": [ - {}, - {}, - {}, - {}, - { - "name": "Electronics" - }, - { - "name": "Computer Science" - }, - { - "name": "Mathematics" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document_with_inline_fragments.json b/ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document_with_inline_fragments.json deleted file mode 100644 index 9e41960e1..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_types_with_missing_types_in_document_with_inline_fragments.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "data": { - "learningSources": [ - { - "name": "The Art of Electronics" - }, - { - "name": "Practical Electronics" - }, - { - "name": "Algorithms to Live By" - }, - { - "name": "Code: The Hidden Language" - }, - {}, - {}, - {} - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json b/ballerina-tests/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json deleted file mode 100644 index 060001aa3..000000000 --- a/ballerina-tests/tests/resources/expected_results/union_types_with_nested_object_includes_field_returning_enum.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data":{ - "profile":{ - "holidays":["SATURDAY", "SUNDAY"], - "school":{ - "name":"CHEM", - "openingDays":["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"] - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/unknown_inline_fragment.json b/ballerina-tests/tests/resources/expected_results/unknown_inline_fragment.json deleted file mode 100644 index ce99fccdd..000000000 --- a/ballerina-tests/tests/resources/expected_results/unknown_inline_fragment.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "errors": [ - { - "message": "Unknown type \"on\".", - "locations": [ - { - "line": 2, - "column": 11 - } - ] - } - ] -} diff --git a/ballerina-tests/tests/resources/expected_results/valid_complexity_query.json b/ballerina-tests/tests/resources/expected_results/valid_complexity_query.json deleted file mode 100644 index aeb5a9270..000000000 --- a/ballerina-tests/tests/resources/expected_results/valid_complexity_query.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "device": { - "brand": "Apple", - "model": "iPhone 15 Pro", - "os": "iOS" - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json b/ballerina-tests/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json deleted file mode 100644 index d773622cd..000000000 --- a/ballerina-tests/tests/resources/expected_results/variable_default_value_with_coerce_int_input_to_float.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weightInPounds": 8.82 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_inside_list_value.json b/ballerina-tests/tests/resources/expected_results/variables_inside_list_value.json deleted file mode 100644 index 5d5d716f4..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_inside_list_value.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "getSuggestions": [ - { - "movieName": "Escape Plan" - }, - { - "movieName": "Papillon" - }, - { - "movieName": "The Fugitive" - } - ] - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json b/ballerina-tests/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json deleted file mode 100644 index 789529f85..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_with_coerce_int_input_to_float.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "weightInPounds": 2.205 - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_with_default_null_value.json b/ballerina-tests/tests/resources/expected_results/variables_with_default_null_value.json deleted file mode 100644 index 2ab387200..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_with_default_null_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "data": { - "isHoliday": false - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_with_default_values.json b/ballerina-tests/tests/resources/expected_results/variables_with_default_values.json deleted file mode 100644 index 35bdbab1f..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_with_default_values.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": { - "profile": { - "address": { - "city": "Albuquerque" - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_with_multiple_operations.json b/ballerina-tests/tests/resources/expected_results/variables_with_multiple_operations.json deleted file mode 100644 index c5a2e56b4..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_with_multiple_operations.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "profile": { - "name": "Walter White", - "age": 50 - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_with_nested_map.json b/ballerina-tests/tests/resources/expected_results/variables_with_nested_map.json deleted file mode 100644 index d23dd4548..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_with_nested_map.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "company": { - "workers": { - "contacts": { - "number": "+94771234567" - } - } - } - } -} diff --git a/ballerina-tests/tests/resources/expected_results/variables_with_query_and_mutation.json b/ballerina-tests/tests/resources/expected_results/variables_with_query_and_mutation.json deleted file mode 100644 index c332a54b9..000000000 --- a/ballerina-tests/tests/resources/expected_results/variables_with_query_and_mutation.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": { - "addShape": { - "name": "Cube", - "edges": 12 - } - } -} diff --git a/ballerina-tests/tests/resources/files/sample1.json b/ballerina-tests/tests/resources/files/sample1.json deleted file mode 100644 index c7bfdc117..000000000 --- a/ballerina-tests/tests/resources/files/sample1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "data": "This is GraphQL File upload" -} diff --git a/ballerina-tests/tests/test_services.bal b/ballerina-tests/tests/test_services.bal deleted file mode 100644 index 82072ea7a..000000000 --- a/ballerina-tests/tests/test_services.bal +++ /dev/null @@ -1,3074 +0,0 @@ -// Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/graphql; -import ballerina/graphql.dataloader; -import ballerina/http; -import ballerina/lang.runtime; -import ballerina/uuid; - -graphql:Service graphiqlDefaultPathConfigService = -@graphql:ServiceConfig { - graphiql: { - enabled: true - } -} -service object { - isolated resource function get greet() returns string { - return "Hello"; - } -}; - -graphql:Service graphiqlConfigService = -@graphql:ServiceConfig { - graphiql: { - enabled: true, - path: "ballerina/graphiql" - } -} -service object { - isolated resource function get greet() returns string { - return "Hello"; - } -}; - -@graphql:ServiceConfig { - graphiql: { - enabled: true - } -} -service /graphiql/test on basicListener { - isolated resource function get greet() returns string { - return "Hello"; - } -} - -@graphql:ServiceConfig { - graphiql: { - enabled: true, - path: "ballerina/graphiql" - } -} -service on basicListener { - isolated resource function get greet() returns string { - return "Hello"; - } -} - -@graphql:ServiceConfig { - graphiql: { - enabled: true - } -} -service on serviceTypeListener { - isolated resource function get greet() returns string { - return "Hello"; - } -} - -@graphql:ServiceConfig { - graphiql: { - enabled: true, - path: "graphiql/interface" - } -} -service /graphiqlClient on basicListener { - isolated resource function get greet() returns string { - return "Hello"; - } -} - -service /fileUpload on basicListener { - resource function get name() returns string { - return "/fileUpload"; - } - - remote function singleFileUpload(graphql:Upload file) returns FileInfo|error { - string contentFromByteStream = check getContentFromByteStream(file.byteStream); - return { - fileName: file.fileName, - mimeType: file.mimeType, - encoding: file.encoding, - content: contentFromByteStream - }; - } - - remote function multipleFileUpload(graphql:Upload[] files) returns FileInfo[]|error { - FileInfo[] fileInfo = []; - foreach int i in 0 ..< files.length() { - graphql:Upload file = files[i]; - string contentFromByteStream = check getContentFromByteStream(file.byteStream); - fileInfo.push({ - fileName: file.fileName, - mimeType: file.mimeType, - encoding: file.encoding, - content: contentFromByteStream - }); - } - return fileInfo; - } -} - -const float CONVERSION_KG_TO_LBS = 2.205; - -service /inputs on basicListener { - isolated resource function get greet(string name) returns string { - return "Hello, " + name; - } - - isolated resource function get name(string name = "Walter") returns string { - return name; - } - - isolated resource function get isLegal(int age) returns boolean { - if age < 21 { - return false; - } - return true; - } - - isolated resource function get quoteById(int id = 0) returns string? { - match id { - 0 => { - return quote1; - } - 1 => { - return quote2; - } - 2 => { - return quote3; - } - } - return; - } - - isolated resource function get weightInPounds(float weightInKg) returns float { - return weightInKg * CONVERSION_KG_TO_LBS; - } - - isolated resource function get isHoliday(Weekday? weekday) returns boolean { - if weekday == SUNDAY || weekday == SATURDAY { - return true; - } - return false; - } - - isolated resource function get getDay(boolean isHoliday) returns Weekday[] { - if isHoliday { - return [SUNDAY, SATURDAY]; - } - return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; - } - - isolated resource function get sendEmail(string message) returns string { - return message; - } - - isolated resource function get 'type(string 'version) returns string { - return 'version; - } - - isolated resource function get \u{0076}ersion(string name) returns string { - return name; - } - - isolated resource function get convertDecimalToFloat(decimal value) returns float|error { - return float:fromString(value.toString()); - } - - isolated resource function get getTotalInDecimal(decimal[][] prices) returns decimal[] { - decimal[] total = []; - decimal sumOfNestedList = 0; - foreach decimal[] nested in prices { - sumOfNestedList = 0; - foreach decimal price in nested { - sumOfNestedList += price; - } - total.push(sumOfNestedList); - } - return total; - } - - isolated resource function get getSubTotal(Item[] items) returns decimal { - decimal subTotal = 0.0; - foreach Item item in items { - subTotal += item.price; - } - return subTotal; - } -} - -service /input_objects on basicListener { - isolated resource function get searchProfile(ProfileDetail profileDetail) returns Person { - if profileDetail?.age == 28 && profileDetail.name == "Jessie" { - return { - name: "Jessie Pinkman", - age: 26, - address: {number: "23B", street: "Negra Arroyo Lane", city: "Albuquerque"} - }; - } else if profileDetail?.age == 30 || profileDetail.name == "Walter" { - return { - name: "Walter White", - age: 50, - address: {number: "9809", street: "Margo Street", city: "Albuquerque"} - }; - } else { - return { - name: "Sherlock Holmes", - age: 40, - address: {number: "221/B", street: "Baker Street", city: "London"} - }; - } - } - - isolated resource function get book(Info info) returns Book[] { - if info.author.name == "Conan Doyle" { - return [b7, b8]; - } else if info.bookName == "Harry Potter" { - return [b9, b10]; - } else if info.author.name == "J.K Rowling" { - return [b9, b10]; - } else if info?.movie?.movieName == "Harry Potter" { - return [b9, b10]; - } else if info?.movie?.director == "Chris Columbus" || info?.movie?.director == "Dexter Fletcher" { - return [b7, b8, b9, b10]; - } else { - return [b7, b8, b9, b10]; - } - } - - isolated resource function get isHoliday(Date date) returns boolean { - if date.day == SUNDAY || date.day == SATURDAY { - return true; - } - return false; - } - - isolated resource function get weightInPounds(Weight weight) returns float { - return weight.weightInKg * CONVERSION_KG_TO_LBS; - } - - isolated resource function get convertKgToGram(WeightInKg weight) returns float { - return weight.weight * 1000.00; - } - - isolated resource function get name(DefaultPerson person) returns string { - return person.name; - } -} - -service /list_inputs on basicListener { - isolated resource function get concat(string?[]? words) returns string { - string result = ""; - if words is string?[] && words.length() > 0 { - foreach string? word in words { - if word is string { - result += word; - result += " "; - } - } - return result.trim(); - } - return "Word list is empty"; - } - - isolated resource function get getTotal(float[][] prices) returns float[] { - float[] total = []; - float sumOfNestedList = 0; - foreach float[] nested in prices { - sumOfNestedList = 0; - foreach float price in nested { - sumOfNestedList += price; - } - total.push(sumOfNestedList); - } - return total; - } - - isolated resource function get searchProfile(ProfileDetail[] profileDetail) returns Person[] { - Person[] results = []; - foreach ProfileDetail profile in profileDetail { - if profile?.age == 28 && profile.name == "Jessie" { - results.push({ - name: "Jessie Pinkman", - age: 26, - address: {number: "23B", street: "Negra Arroyo Lane", city: "Albuquerque"} - }); - } else if profile?.age == 30 || profile.name == "Walter" { - results.push({ - name: "Walter White", - age: 50, - address: {number: "9809", street: "Margo Street", city: "Albuquerque"} - }); - } else { - results.push({ - name: "Sherlock Holmes", - age: 40, - address: {number: "221/B", street: "Baker Street", city: "London"} - }); - } - } - return results; - } - - resource function get getSuggestions(TvSeries[] tvSeries) returns Movie[] { - Movie[] results = [m1, m2, m3, m4, m5, m6]; - foreach TvSeries item in tvSeries { - if item.name == "Breaking Bad" { - results = [m3]; - } else if item.name == "Prison Break" { - results = [m4, m5, m6]; - } else if item?.episodes is Episode[] { - Episode[] episodes = item?.episodes; - foreach Episode epi in episodes { - if epi?.newCharacters is string[] { - string[] characters = epi?.newCharacters; - foreach string name in characters { - if name == "Sara" || name == "Michael" || name == "Lincoln" { - results = [m4, m5, m6]; - } - } - } - } - } - } - return results; - } - - resource function get getMovie(TvSeries tvSeries) returns Movie[] { - Movie[] results = [m1, m2, m3, m4, m5, m6]; - if tvSeries?.episodes is Episode[] { - Episode[] episodes = tvSeries?.episodes; - foreach Episode episode in episodes { - if episode?.newCharacters is string[] { - string[] characters = episode?.newCharacters; - foreach string name in characters { - if name == "Sara" || name == "Michael" || name == "Lincoln" { - results = [m4, m5, m6]; - } else if name == "Harry" || name == "Hagrid" { - results = [m1]; - } else if name == "Sherlock" { - results = [m2]; - } - } - } else { - if episode.title == "The Key" || episode.title == "Flight" { - results = [m4, m5]; - } else if episode.title == "Cancer Man" { - results = [m3]; - } - } - } - } - return results; - } - - isolated resource function get isIncludeHoliday(Weekday[] days = [MONDAY, FRIDAY]) returns boolean { - if days.indexOf(SUNDAY) != () || days.indexOf(SATURDAY) != () { - return true; - } - return false; - } -} - -service /records on basicListener { - isolated resource function get detective() returns Person { - return { - name: "Sherlock Holmes", - age: 40, - address: {number: "221/B", street: "Baker Street", city: "London"} - }; - } - - isolated resource function get teacher() returns Person { - return { - name: "Walter White", - age: 50, - address: {number: "308", street: "Negra Arroyo Lane", city: "Albuquerque"} - }; - } - - isolated resource function get student() returns Person { - return { - name: "Jesse Pinkman", - age: 25, - address: {number: "9809", street: "Margo Street", city: "Albuquerque"} - }; - } - - resource function get profile(int id) returns Person|error { - return trap people[id]; - } - - resource function get people() returns Person[] { - return people; - } - - resource function get students() returns Student[] { - return students; - } -} - -service /service_types on serviceTypeListener { - isolated resource function get greet() returns GeneralGreeting { - return new; - } - - isolated resource function get profile() returns Profile { - return new; - } - - isolated resource function get person(graphql:Field 'field) returns Person { - string[] subfieldNames = 'field.getSubfieldNames(); - if subfieldNames == ["name"] { - return { - name: "Sherlock Holmes", - address: {number: "221/B", street: "Baker Street", city: "London"} - }; - } else if subfieldNames == ["name", "age"] { - return { - name: "Walter White", - age: 50, - address: {number: "309", street: "Negro Arroyo Lane", city: "Albuquerque"} - }; - } - return { - name: "Jesse Pinkman", - age: 25, - address: {number: "208", street: "Margo Street", city: "Albuquerque"} - }; - } -} - -service /service_objects on serviceTypeListener { - isolated resource function get ids() returns int[] { - return [0, 1, 2]; - } - - isolated resource function get allVehicles() returns Vehicle[] { - Vehicle v1 = new ("V1", "Benz", 2005); - Vehicle v2 = new ("V2", "BMW", 2010); - Vehicle v3 = new ("V3", "Ford"); - return [v1, v2, v3]; - } - - isolated resource function get searchVehicles(string keyword) returns Vehicle[]? { - Vehicle v1 = new ("V1", "Benz"); - Vehicle v2 = new ("V2", "BMW"); - Vehicle v3 = new ("V3", "Ford"); - return [v1, v2, v3]; - } - - isolated resource function get teacher() returns TeacherService { - return new TeacherService(737, "Walter White", "Chemistry"); - } - - isolated resource function get student(string name, graphql:Context context, int id, - graphql:Field 'field) returns StudentService { - if context.get("scope") is error { - // ignore - } - if 'field.getSubfieldNames().indexOf("id") is int { - return new StudentService(id, name); - } - return new StudentService(10, "Jesse Pinkman"); - } -} - -service /timeoutService on timeoutListener { - isolated resource function get greet() returns string { - runtime:sleep(3); - return "Hello"; - } -} - -@graphql:ServiceConfig { - cors: { - allowOrigins: ["*"], - allowCredentials: true, - allowHeaders: ["X-Content-Type-Options"], - exposeHeaders: ["X-CUSTOM-HEADER"], - allowMethods: ["*"], - maxAge: 84900 - } -} -service /corsConfigService1 on basicListener { - isolated resource function get greet() returns string { - return "Hello"; - } -} - -@graphql:ServiceConfig { - cors: { - allowOrigins: ["http://www.wso2.com"], - allowCredentials: true, - allowHeaders: ["X-Content-Type-Options", "X-PINGOTHER"], - exposeHeaders: ["X-HEADER"], - allowMethods: ["POST"] - } -} -service /corsConfigService2 on basicListener { - isolated resource function get greet() returns string { - return "Hello"; - } -} - -service /profiles on hierarchicalPathListener { - isolated resource function get profile/name/first() returns string { - return "Sherlock"; - } - - isolated resource function get profile/name/last() returns string { - return "Holmes"; - } - - isolated resource function get profile/age() returns int { - return 40; - } - - isolated resource function get profile/address/city() returns string { - return "London"; - } - - isolated resource function get profile/address/street() returns string { - return "Baker Street"; - } - - isolated resource function get profile/name/address/number() returns string { - return "221/B"; - } -} - -service /snowtooth on hierarchicalPathListener { - isolated resource function get lift/name() returns string { - return "Lift1"; - } - - isolated resource function get mountain/trail/getLift/name() returns string { - return "Lift2"; - } -} - -service /hierarchical on hierarchicalPathListener { - isolated resource function get profile/personal() returns HierarchicalName { - return new (); - } -} - -service /tables on basicListener { - resource function get employees() returns EmployeeTable? { - return employees; - } - - resource function get tasks() returns TaskTable { - return tasks; - } -} - -service /special_types on specialTypesTestListener { - isolated resource function get weekday(int number) returns Weekday { - match number { - 1 => { - return MONDAY; - } - 2 => { - return TUESDAY; - } - 3 => { - return WEDNESDAY; - } - 4 => { - return THURSDAY; - } - 5 => { - return FRIDAY; - } - 6 => { - return SATURDAY; - } - } - return SUNDAY; - } - - isolated resource function get day(int number) returns Weekday|error { - if number < 1 || number > 7 { - return error("Invalid number"); - } else if number == 1 { - return MONDAY; - } else if number == 2 { - return TUESDAY; - } else if number == 3 { - return WEDNESDAY; - } else if number == 4 { - return THURSDAY; - } else if number == 5 { - return FRIDAY; - } else if number == 6 { - return SATURDAY; - } else { - return SUNDAY; - } - } - - isolated resource function get time() returns Time { - return { - weekday: MONDAY, - time: "22:10:33" - }; - } - - isolated resource function get isHoliday(Weekday weekday) returns boolean { - if weekday == SATURDAY || weekday == SUNDAY { - return true; - } - return false; - } - - isolated resource function get holidays() returns Weekday[] { - return [SATURDAY, SUNDAY]; - } - - isolated resource function get openingDays() returns (Weekday|error)[] { - return [MONDAY, TUESDAY, error("Holiday!"), THURSDAY, FRIDAY]; - } - - isolated resource function get specialHolidays() returns (Weekday|error)?[] { - return [TUESDAY, error("Holiday!"), THURSDAY]; - } - - resource function get company() returns Company { - return company; - } - - resource function get month(Month month) returns string { - return month; - } - - isolated resource function get ids() returns int[] { - return [0, 1, 2]; - } - - isolated resource function get idsWithErrors() returns (int|error)[] { - return [0, 1, 2, error("Not Found!")]; - } - - isolated resource function get friends() returns (string|error)?[] { - return ["walter", "jessie", error("Not Found!")]; - } - - isolated resource function get project() returns Project { - return { - name: "Ballerina", - manager: "Unknown", - tasks: { - sprint: 75, - subTasks: ["GraphQL-task1", error("Undefined task!"), "HTTP-task2"] - } - }; - } -} - -service /snowtooth on serviceTypeListener { - isolated resource function get allLifts(Status? status) returns Lift[] { - if status is Status { - return from var lift in liftTable - where lift.status == status - select new (lift); - } else { - return from var lift in liftTable - select new (lift); - } - } - - isolated resource function get allTrails(Status? status) returns Trail[] { - if status is Status { - return from var trail in trailTable - where trail.status == status - select new (trail); - } else { - return from var trail in trailTable - select new (trail); - } - } - - isolated resource function get lift(string id) returns Lift? { - LiftRecord[] lifts = from var lift in liftTable - where lift.id == id - select lift; - if lifts.length() > 0 { - return new Lift(lifts[0]); - } - return; - } - - isolated resource function get trail(string id) returns Trail? { - TrailRecord[] trails = from var trail in trailTable - where trail.id == id - select trail; - if trails.length() > 0 { - return new Trail(trails[0]); - } - return; - } - - isolated resource function get liftCount(Status status) returns int { - LiftRecord[] lifts = from var lift in liftTable - where lift.status == status - select lift; - return lifts.length(); - } - - isolated resource function get trailCount(Status status) returns int { - TrailRecord[] trails = from var trail in trailTable - where trail.status == status - select trail; - return trails.length(); - } - - isolated resource function get search(Status status) returns SearchResult[] { - SearchResult[] searchResults = []; - Trail[] trails = from var trail in trailTable - where trail.status == status - select new (trail); - Lift[] lifts = from var lift in liftTable - where lift.status == status - select new (lift); - foreach Trail trail in trails { - searchResults.push(trail); - } - foreach Lift lift in lifts { - searchResults.push(lift); - } - return searchResults; - } -} - -service /unions on serviceTypeListener { - isolated resource function get profile(int id) returns StudentService|TeacherService { - if id < 100 { - return new StudentService(1, "Jesse Pinkman"); - } else { - return new TeacherService(737, "Walter White", "Chemistry"); - } - } - - isolated resource function get search() returns (StudentService|TeacherService)[] { - StudentService s = new StudentService(1, "Jesse Pinkman"); - TeacherService t = new TeacherService(737, "Walter White", "Chemistry"); - return [s, t]; - } - - isolated resource function get services() returns PeopleService?[] { - StudentService s = new StudentService(1, "Jesse Pinkman"); - TeacherService t = new TeacherService(737, "Walter White", "Chemistry"); - return [s, t, ()]; - } -} - -service /union_type_names on serviceTypeListener { - private final StudentService s = new StudentService(1, "Jesse Pinkman"); - private final TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); - - isolated resource function get nonNullSingleObject() returns PeopleService { - return self.s; - } - - isolated resource function get nullableSingleObject() returns PeopleService? { - return self.s; - } - - isolated resource function get nonNullArray() returns PeopleService[] { - return [self.s, self.t]; - } - - isolated resource function get nullableArray() returns PeopleService?[] { - return [self.s, ()]; - } - - isolated resource function get nonNullUndefinedUnionType() returns StudentService|TeacherService { - return self.s; - } - - isolated resource function get nonNullUndefinedUnionTypeArray() returns (StudentService|TeacherService)[] { - return [self.s]; - } - - isolated resource function get nullableUndefinedUnionType() returns StudentService|TeacherService? { - return self.s; - } - - isolated resource function get nullableUndefinedUnionTypeArray() returns (StudentService|TeacherService)?[] { - return [self.s, ()]; - } -} - -// **************** Security-Related Services **************** -// Unsecured service -service /noAuth on secureListener { - isolated resource function get greeting() returns string { - return "Hello World!"; - } -} - -// Basic auth secured service -@graphql:ServiceConfig { - auth: [ - { - fileUserStoreConfig: {}, - scopes: ["write", "update"] - } - ], - graphiql: { - enabled: true - } -} -service /basicAuth on secureListener { - isolated resource function get greeting() returns string { - return "Hello World!"; - } -} - -// JWT auth secured service -@graphql:ServiceConfig { - auth: [ - { - jwtValidatorConfig: { - issuer: "wso2", - audience: "ballerina", - signatureConfig: { - trustStoreConfig: { - trustStore: { - path: TRUSTSTORE_PATH, - password: "ballerina" - }, - certAlias: "ballerina" - } - }, - scopeKey: "scp" - }, - scopes: ["write", "update"] - } - ] -} -service /jwtAuth on secureListener { - isolated resource function get greeting() returns string { - return "Hello World!"; - } -} - -// OAuth2 auth secured service -@graphql:ServiceConfig { - auth: [ - { - oauth2IntrospectionConfig: { - url: "https://localhost:9445/oauth2/introspect", - tokenTypeHint: "access_token", - scopeKey: "scp", - clientConfig: { - secureSocket: { - cert: { - path: TRUSTSTORE_PATH, - password: "ballerina" - } - } - } - }, - scopes: ["write", "update"] - } - ] -} -service /oauth2 on secureListener { - isolated resource function get greeting() returns string { - return "Hello World!"; - } -} - -// Testing multiple auth configurations support. -// OAuth2, Basic auth & JWT auth secured service -@graphql:ServiceConfig { - auth: [ - { - oauth2IntrospectionConfig: { - url: "https://localhost:9445/oauth2/introspect", - tokenTypeHint: "access_token", - scopeKey: "scp", - clientConfig: { - secureSocket: { - cert: { - path: TRUSTSTORE_PATH, - password: "ballerina" - } - } - } - }, - scopes: ["write", "update"] - }, - { - fileUserStoreConfig: {}, - scopes: ["write", "update"] - }, - { - jwtValidatorConfig: { - issuer: "wso2", - audience: "ballerina", - signatureConfig: { - trustStoreConfig: { - trustStore: { - path: TRUSTSTORE_PATH, - password: "ballerina" - }, - certAlias: "ballerina" - } - }, - scopeKey: "scp" - }, - scopes: ["write", "update"] - } - ] -} -service /multipleAuth on secureListener { - isolated resource function get greeting() returns string { - return "Hello World!"; - } -} - -// JWT auth secured service (without scopes) -@graphql:ServiceConfig { - auth: [ - { - jwtValidatorConfig: { - issuer: "wso2", - audience: "ballerina", - signatureConfig: { - trustStoreConfig: { - trustStore: { - path: TRUSTSTORE_PATH, - password: "ballerina" - }, - certAlias: "ballerina" - } - } - } - } - ] -} -service /noScopes on secureListener { - isolated resource function get greeting() returns string { - return "Hello World!"; - } -} - -// **************** Security-Related Services **************** - -isolated service /mutations on basicListener { - private Person p; - private TeacherService t; - - isolated function init() { - self.p = p2.clone(); - self.t = new (1, "Walter Bishop", "Physics"); - } - - isolated resource function get person() returns Person { - lock { - return self.p; - } - } - - isolated remote function setName(string name) returns Person { - lock { - Person p = {name: name, age: self.p.age, address: self.p.address}; - self.p = p; - return self.p; - } - } - - isolated remote function setCity(string city) returns Person { - lock { - Person p = { - name: self.p.name, - age: self.p.age, - address: { - number: self.p.address.number, - street: self.p.address.street, - city: city - } - }; - self.p = p; - return self.p; - } - } - - isolated remote function setTeacherName(string name) returns TeacherService { - lock { - self.t.setName(name); - return self.t; - } - } - - isolated remote function setTeacherSubject(string subject) returns TeacherService { - lock { - self.t.setSubject(subject); - return self.t; - } - } -} - -service /null_values on basicListener { - resource function get profile(int? id) returns Person { - if id == () { - return p1; - } - return p2; - } - - remote function profile(string? name = ()) returns Person { - if name == () { - return p1; - } - return p2; - } - - resource function get book(Author? author) returns Book { - if author == {name: (), id: 1} { - return b1; - } else if author == {name: "J. K. Rowling", id: 2} { - return { - name: "Harry Potter and the Prisnor of the Azkaban", - author: "J. K. Rowling" - }; - } - return b3; - } - - resource function get 'null(int? value) returns string? { - if value != () { - return "Hello"; - } - return; - } - - resource function get name(graphql:Context context, graphql:Field 'field, int? id) returns string? { - if id == () { - graphql:__addError(context, { - message: "Data not found", - locations: ['field.getLocation()], - path: 'field.getPath() - }); - return; - } - return "Walter White"; - } -} - -@graphql:ServiceConfig { - contextInit: - isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context context = new; - context.set("scope", check request.getHeader("scope")); - return context; - } -} - -service /context on serviceTypeListener { - isolated resource function get profile(graphql:Context context) returns Person|error { - var scope = check context.get("scope"); - if scope is string && scope == "admin" { - return { - name: "Walter White", - age: 51, - address: { - number: "308", - street: "Negra Arroyo Lane", - city: "Albuquerque" - } - }; - } else { - return error("You don't have permission to retrieve data"); - } - } - - isolated resource function get name(graphql:Context context, string name) returns string|error { - var scope = check context.get("scope"); - if scope is string && scope == "admin" { - return name; - } else { - return error("You don't have permission to retrieve data"); - } - } - - isolated resource function get animal() returns AnimalClass { - return new; - } - - remote function update(graphql:Context context) returns (Person|error)[]|error { - var scope = check context.get("scope"); - if scope is string && scope == "admin" { - return people; - } else { - return [p1, error("You don't have permission to retrieve data"), p3]; - } - } - - remote function updateNullable(graphql:Context context) returns (Person|error?)[]|error { - var scope = check context.get("scope"); - if scope is string && scope == "admin" { - return people; - } else { - return [p1, error("You don't have permission to retrieve data"), p3]; - } - } - - isolated resource function subscribe messages(graphql:Context context) returns stream|error { - var scope = context.get("scope"); - if scope is string && scope == "admin" { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } - return error("You don't have permission to retrieve data"); - } -} - -service /intersection_types on basicListener { - isolated resource function get name(Species & readonly species) returns string { - return species.specificName; - } - - isolated resource function get city(Address address) returns string { - return address.city; - } - - isolated resource function get profile() returns ProfileDetail & readonly { - ProfileDetail profile = {name: "Walter White", age: 52}; - return profile.cloneReadOnly(); - } - - isolated resource function get book() returns Book { - return {name: "Nineteen Eighty-Four", author: "George Orwell"}; - } - - isolated resource function get names(Species[] & readonly species) returns string[] { - return species.map(sp => sp.specificName); - } - - isolated resource function get cities(Address[] addresses) returns string[] { - return addresses.map(address => address.city); - } - - isolated resource function get profiles() returns ProfileDetail[] & readonly { - ProfileDetail[] profiles = [ - {name: "Walter White", age: 52}, - {name: "Jesse Pinkman", age: 25} - ]; - return profiles.cloneReadOnly(); - } - - isolated resource function get books() returns Book[] { - return [ - {name: "Nineteen Eighty-Four", author: "George Orwell"}, - {name: "The Magic of Reality", author: "Richard Dawkins"} - ]; - } - - isolated resource function get commonName(Animal animal) returns string { - return animal.commonName; - } - - isolated resource function get ownerName(Pet pet) returns string { - return pet.ownerName; - } -} - -service /nullable_inputs on basicListener { - resource function get city(Address? address) returns string? { - if address is Address { - return address.city; - } - return; - } - - resource function get cities(Address[]? addresses) returns string[]? { - if addresses is Address[] { - return addresses.map(address => address.city); - } - return; - } - - resource function get accountNumber(Account account) returns int { - return account.number; - } -} - -public string[] namesArray = ["Walter", "Skyler"]; - -service /subscriptions on subscriptionListener { - isolated resource function get name() returns string { - return "Walter White"; - } - - resource function subscribe name() returns stream { - return namesArray.toStream(); - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } - - isolated resource function subscribe stringMessages() returns stream { - string?[] stringArray = [(), "1", "2", "3", "4", "5"]; - return stringArray.toStream(); - } - - isolated resource function subscribe books() returns stream { - Book[] books = [ - {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, - {name: "A Game of Thrones", author: "George R.R. Martin"} - ]; - return books.toStream(); - } - - isolated resource function subscribe students() returns stream { - StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; - return students.toStream(); - } - - isolated resource function subscribe filterValues(int value) returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - int[] filteredArray = []; - foreach int i in intArray { - if i < value { - filteredArray.push(i); - } - } - return filteredArray.toStream(); - } - - isolated resource function subscribe values() returns stream|error { - int[] array = []; - int _ = check trap array.remove(0); - return array.toStream(); - } - - isolated resource function subscribe multipleValues() returns stream<(PeopleService)>|error { - StudentService s = new StudentService(1, "Jesse Pinkman"); - TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); - return [s, t].toStream(); - } - - isolated resource function subscribe evenNumber() returns stream { - EvenNumberGenerator evenNumberGenerator = new; - return new (evenNumberGenerator); - } - - isolated resource function subscribe refresh() returns stream { - RefreshData dataRefersher = new; - return new (dataRefersher); - } -} - -# GraphQL service with documentation. -service /documentation on basicListener { - - # Greets a person with provided name. - # - # + name - The name of the person - # + return - The personalized greeting message - isolated resource function get greeting(string name) returns string { - return string `Hello ${name}`; - } - - # Returns a predefined instrument. - # - # + return - Details of the Guitar - isolated resource function get instrument() returns Instrument { - return { - name: "Guitar", - 'type: STRINGS - }; - } - - # Updates a shape in the database. - # - # + name - Name of the new shape - # + edges - Number of edges of the new shape - # + return - The newly created shape - remote function addShape(string name, int edges) returns Shape { - return {name: name, edges: edges}; - } -} - -# GraphQL service with deprecated fields and enum values. -service /deprecation on wrappedListener { - - # Hello world field. - # + name - The name of the person - # + return - The personalized greeting message - # # Deprecated - # Use the `greeting` field instead of this field. - @deprecated - isolated resource function get hello(string name) returns string { - return string `Hello ${name}`; - } - - # Greets a person with provided name. - # - # + name - The name of the person - # + return - The personalized greeting message - isolated resource function get greeting(string name) returns string { - return string `Hello ${name}`; - } - - # Retrieve information about the person. - # + return - The person object - isolated resource function get profile() returns DeprecatedProfile { - return {name: "Alice", age: 30, address: {number: 1, street: "main", city: "NYC"}}; - } - - # Retrieve information about music school. - # + return - The school object - isolated resource function get school() returns School { - return new ("The Juilliard School"); - } - - # Add a new person. - # + return - The person object - remote function addProfile(string name, int age) returns DeprecatedProfile { - return {name: name, age: age, address: {number: 1, street: "main", city: "NYC"}}; - } - - # Creates a new instrument. - # - # + name - Name of the instrument - # + 'type - Type of the instrument - # + return - The newly created instrument - # # Deprecated - # Use the `addInstrument` field instead of this. - @deprecated - remote function newInstrument(string name, InstrumentType 'type) returns Instrument { - return {name: name, 'type: 'type}; - } - - # Adds a new instrument to the database. - # - # + name - Name of the instrument - # + 'type - Type of the instrument - # + return - The newly added instrument - remote function addInstrument(string name, InstrumentType 'type) returns Instrument { - return {name: name, 'type: 'type}; - } - - # Subscribes to the new instruments. - # - # + return - The instrument name list - # # Deprecated - # Use the `instruments` field instead of this. - @deprecated - resource function subscribe newInstruments() returns stream { - return ["Guitar", "Violin", "Drums"].toStream(); - } - - # Subscribes to the new instruments. - # - # + return - The instrument name list - resource function subscribe instruments() returns stream { - return ["Guitar", "Violin", "Drums"].toStream(); - } -} - -// **************** Interceptor-Related Services **************** - -@graphql:ServiceConfig { - interceptors: [new StringInterceptor4(), new StringInterceptor5(), new StringInterceptor6()] -} -service /intercept_string on basicListener { - @graphql:ResourceConfig { - interceptors: [new StringInterceptor1(), new StringInterceptor2(), new StringInterceptor3()] - } - resource function get enemy() returns string { - return "voldemort"; - } -} - -@graphql:ServiceConfig { - interceptors: [new Counter(), new Counter(), new Counter()] -} -service /intercept_int on basicListener { - @graphql:ResourceConfig { - interceptors: [new Counter(), new Counter(), new Counter()] - } - isolated resource function get age() returns int { - return 23; - } -} - -@graphql:ServiceConfig { - interceptors: [new RecordInterceptor1(), new LogSubfields()] -} -service /intercept_records on basicListener { - isolated resource function get profile() returns Person { - return { - name: "Albus Percival Wulfric Brian Dumbledore", - age: 80, - address: {number: "101", street: "Mould-on-the-Wold", city: "London"} - }; - } - - @graphql:ResourceConfig { - interceptors: new RecordInterceptor2() - } - isolated resource function get contact() returns Contact { - return { - number: "+12345678" - }; - } -} - -@graphql:ServiceConfig { - interceptors: [new HierarchicalPath1(), new HierarchicalPath3()] -} -service /intercept_hierarchical on basicListener { - @graphql:ResourceConfig { - interceptors: new HierarchicalPath2() - } - isolated resource function get name/first() returns string { - return "Sherlock"; - } - - isolated resource function get name/last() returns string { - return "Holmes"; - } -} - -@graphql:ServiceConfig { - interceptors: new Destruct1() -} -service /intercept_service_obj_array1 on basicListener { - resource function get students() returns StudentService[] { - return [new StudentService(45, "Ron Weasly"), new StudentService(46, "Hermione Granger")]; - } - - @graphql:ResourceConfig { - interceptors: [new Destruct2()] - } - resource function get teachers() returns TeacherService[] { - TeacherService t1 = new TeacherService(45, "Severus Snape", "Defence Against the Dark Arts"); - return [t1]; - } -} - -@graphql:ServiceConfig { - interceptors: new ServiceObjectInterceptor1() -} -service /intercept_service_obj on basicListener { - resource function get teacher() returns TeacherService { - return new TeacherService(2, "Severus Snape", "Defence Against the Dark Arts"); - } - - @graphql:ResourceConfig { - interceptors: [new ServiceObjectInterceptor3()] - } - resource function get student() returns StudentService { - return new StudentService(1, "Harry Potter"); - } -} - -@graphql:ServiceConfig { - interceptors: new ServiceObjectInterceptor2() -} -service /intercept_service_obj_array2 on basicListener { - resource function get students() returns StudentService[] { - return [new StudentService(45, "Ron Weasly"), new StudentService(46, "Hermione Granger")]; - } - - @graphql:ResourceConfig { - interceptors: [new ServiceObjectInterceptor4()] - } - resource function get teachers() returns TeacherService[] { - return [new TeacherService(2, "Severus Snape", "Defence Against the Dark Arts")]; - } -} - -@graphql:ServiceConfig { - interceptors: new ArrayInterceptor1() -} -service /intercept_arrays on basicListener { - @graphql:ResourceConfig { - interceptors: new ArrayInterceptor2() - } - resource function get houses() returns string[] { - return ["Gryffindor(Fire)", "Hufflepuff(Earth)"]; - } -} - -@graphql:ServiceConfig { - interceptors: new EnumInterceptor1() -} -service /intercept_enum on basicListener { - @graphql:ResourceConfig { - interceptors: [new EnumInterceptor2()] - } - isolated resource function get holidays() returns Weekday[] { - return []; - } -} - -@graphql:ServiceConfig { - interceptors: new UnionInterceptor1() -} -service /intercept_unions on serviceTypeListener { - isolated resource function get profile1(int id) returns StudentService|TeacherService { - if id < 100 { - return new StudentService(1, "Jesse Pinkman"); - } - return new TeacherService(737, "Walter White", "Chemistry"); - } - - @graphql:ResourceConfig { - interceptors: new UnionInterceptor2() - } - isolated resource function get profile2(int id) returns StudentService|TeacherService { - if id > 100 { - return new StudentService(1, "Jesse Pinkman"); - } - return new TeacherService(737, "Walter White", "Chemistry"); - } -} - -@graphql:ServiceConfig { - interceptors: [new RecordFieldInterceptor1(), new RecordFieldInterceptor2(), new ServiceLevelInterceptor(), new RecordFieldInterceptor3()] -} -service /intercept_record_fields on basicListener { - isolated resource function get profile() returns Person { - return { - name: "Rubeus Hagrid", - age: 70, - address: {number: "103", street: "Mould-on-the-Wold", city: "London"} - }; - } - - isolated resource function get newProfile() returns Person? { - return { - name: "Rubeus Hagrid", - age: 70, - address: {number: "103", street: "Mould-on-the-Wold", city: "London"} - }; - } -} - -@graphql:ServiceConfig { - interceptors: new MapInterceptor1() -} -service /intercept_map on basicListener { - private final Languages languages; - - function init() { - self.languages = { - name: { - backend: "Ballerina", - frontend: "JavaScript", - data: "Python", - native: "C++" - } - }; - } - - isolated resource function get languages() returns Languages { - return self.languages; - } - - @graphql:ResourceConfig { - interceptors: new MapInterceptor2() - } - isolated resource function get updatedLanguages() returns Languages { - return { - name: { - backend: "Ruby", - frontend: "Java", - data: "Ballerina", - native: "C++" - } - }; - } -} - -@graphql:ServiceConfig { - interceptors: new TableInterceptor1() -} -service /intercept_table on basicListener { - isolated resource function get employees() returns EmployeeTable? { - return employees; - } - - @graphql:ResourceConfig { - interceptors: new TableInterceptor2() - } - isolated resource function get oldEmployees() returns EmployeeTable? { - return employees; - } -} - -@graphql:ServiceConfig { - interceptors: [new InterceptMutation1(), new ServiceLevelInterceptor()] -} -isolated service /mutation_interceptor on basicListener { - private Person p; - - isolated function init() { - self.p = p2.clone(); - } - - isolated resource function get person() returns Person { - lock { - return self.p; - } - } - - isolated remote function setName(string name) returns Person { - lock { - Person p = {name: name, age: self.p.age, address: self.p.address}; - self.p = p; - return self.p; - } - } - - @graphql:ResourceConfig { - interceptors: new InterceptMutation2() - } - isolated remote function setAge(int age) returns Person { - lock { - Person p = {name: self.p.name, age: age, address: self.p.address}; - self.p = p; - return self.p; - } - } - - isolated resource function get customer() returns Customer { - return new (1, "Sherlock"); - } - - isolated resource function get newPerson() returns Person? { - lock { - return self.p; - } - } -} - -@graphql:ServiceConfig { - interceptors: [new Subtraction(), new Multiplication()] -} -isolated service /subscription_interceptor1 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - @graphql:ResourceConfig { - interceptors: [new Subtraction(), new Multiplication()] - } - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: [new InterceptAuthor(), new ServiceLevelInterceptor()] -} -isolated service /subscription_interceptor2 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe books() returns stream { - Book?[] books = [ - {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, - {name: "A Game of Thrones", author: "George R.R. Martin"}, - () - ]; - return books.toStream(); - } - - @graphql:ResourceConfig { - interceptors: [new InterceptBook()] - } - isolated resource function subscribe newBooks() returns stream { - Book?[] books = [ - {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, - () - ]; - return books.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: new InterceptStudentName() -} -isolated service /subscription_interceptor3 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe students() returns stream { - StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; - return students.toStream(); - } - - @graphql:ResourceConfig { - interceptors: [new InterceptStudent()] - } - isolated resource function subscribe newStudents() returns stream { - StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; - return students.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: new InterceptUnionType1() -} -isolated service /subscription_interceptor4 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe multipleValues1() returns stream|error { - StudentService s = new StudentService(1, "Jesse Pinkman"); - TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); - return [s, t].toStream(); - } - - @graphql:ResourceConfig { - interceptors: new InterceptUnionType2() - } - isolated resource function subscribe multipleValues2() returns stream|error { - StudentService s = new StudentService(1, "Harry Potter"); - TeacherService t = new TeacherService(3, "Severus Snape", "Dark Arts"); - return [s, t].toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: new ReturnBeforeResolver() -} -isolated service /subscription_interceptor5 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: [new DestructiveModification()] -} -isolated service /subscription_interceptor6 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - @graphql:ResourceConfig { - interceptors: new DestructiveModification() - } - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: [new InvalidInterceptor1(), new InvalidInterceptor2()] -} -service /invalid_interceptor1 on basicListener { - @graphql:ResourceConfig { - interceptors: [new InvalidInterceptor8(), new InvalidInterceptor9()] - } - isolated resource function get age() returns int { - return 23; - } -} - -@graphql:ServiceConfig { - interceptors: [new InvalidInterceptor3(), new InvalidInterceptor4()] -} -service /invalid_interceptor2 on basicListener { - @graphql:ResourceConfig { - interceptors: new InvalidInterceptor8() - } - isolated resource function get friends() returns string[] { - return ["Harry", "Ron", "Hermione"]; - } -} - -@graphql:ServiceConfig { - interceptors: [new InvalidInterceptor5(), new InvalidInterceptor6()] -} -service /invalid_interceptor3 on basicListener { - @graphql:ResourceConfig { - interceptors: new InvalidInterceptor9() - } - isolated resource function get person() returns Person { - return { - name: "Albus Percival Wulfric Brian Dumbledore", - age: 80, - address: {number: "101", street: "Mould-on-the-Wold", city: "London"} - }; - } -} - -@graphql:ServiceConfig { - interceptors: new InvalidInterceptor7() -} -service /invalid_interceptor4 on basicListener { - @graphql:ResourceConfig { - interceptors: new InvalidInterceptor9() - } - resource function get student() returns StudentService { - return new StudentService(45, "Ron Weasly"); - } -} - -@graphql:ServiceConfig { - interceptors: new ErrorInterceptor1() -} -service /intercept_errors1 on basicListener { - isolated resource function get greet() returns string|error { - return error("This is an invalid field!"); - } -} - -@graphql:ServiceConfig { - interceptors: [new ErrorInterceptor1()] -} -service /intercept_errors2 on basicListener { - isolated resource function get friends() returns string[] { - return ["Harry", "Ron", "Hermione"]; - } -} - -@graphql:ServiceConfig { - interceptors: new ErrorInterceptor1() -} -service /intercept_errors3 on basicListener { - isolated resource function get person() returns Person { - return { - name: "Albus Percival Wulfric Brian Dumbledore", - age: 80, - address: {number: "101", street: "Mould-on-the-Wold", city: "London"} - }; - } -} - -@graphql:ServiceConfig { - interceptors: [new Execution1(), new Execution2()], - contextInit: - isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context context = new; - context.set("subject", "Ballerina"); - context.set("beVerb", "is"); - context.set("object", "purpose"); - return context; - } -} -service /intercept_order on basicListener { - isolated resource function get quote() returns string { - return "an open-source"; - } - - @graphql:ResourceConfig { - interceptors: [new Execution3(), new Execution4()] - } - isolated resource function get status() returns string { - return "general"; - } -} - -@graphql:ServiceConfig { - interceptors: new AccessGrant() -} -service /intercept_erros_with_hierarchical on basicListener { - resource function get name() returns string { - return "Walter"; - } - - resource function get age() returns int? { - return 67; - } - - resource function get address/number() returns int? { - return 221; - } - - resource function get address/street() returns string? { - return "Main Street"; - } - - @graphql:ResourceConfig { - interceptors: new ErrorInterceptor1() - } - resource function get address/city() returns string? { - return "London"; - } -} - -@graphql:ServiceConfig { - interceptors: new RecordInterceptor1() -} -service /interceptors_with_null_values1 on basicListener { - resource function get name() returns string? { - return; - } -} - -@graphql:ServiceConfig { - interceptors: new NullReturn1() -} -service /interceptors_with_null_values2 on basicListener { - resource function get name() returns string? { - return "Ballerina"; - } - - @graphql:ResourceConfig { - interceptors: new NullReturn2() - } - resource function get age() returns int? { - return 44; - } -} - -@graphql:ServiceConfig { - interceptors: new NullReturn1() -} -service /interceptors_with_null_values3 on basicListener { - resource function get name() returns string { - return "Ballerina"; - } - - @graphql:ResourceConfig { - interceptors: new NullReturn2() - } - resource function get age() returns int { - return 44; - } -} - -service /maps on basicListener { - private final Languages languages; - - function init() { - self.languages = { - name: { - backend: "Ballerina", - frontend: "JavaScript", - data: "Python", - native: "C++" - } - }; - } - - isolated resource function get languages() returns Languages { - return self.languages; - } -} - -graphql:Service greetingService = service object { - resource function get greeting() returns string { - return "Hello, World"; - } -}; - -graphql:Service greetingService2 = @graphql:ServiceConfig {maxQueryDepth: 5} service object { - resource function get greeting() returns string { - return "Hello, World"; - } -}; - -service /covid19 on basicListener { - resource function get all() returns table { - table covidEntryTable = table [ - {isoCode: "AFG"}, - {isoCode: "SL"}, - {isoCode: "US"} - ]; - return covidEntryTable; - } -} - -table reviews = table [ - {product: new ("1"), score: 20, description: "Product 01"}, - {product: new ("2"), score: 20, description: "Product 02"}, - {product: new ("3"), score: 20, description: "Product 03"}, - {product: new ("4"), score: 20, description: "Product 04"}, - {product: new ("5"), score: 20, description: "Product 05"} -]; - -service /reviews on wrappedListener { - resource function get latest() returns Review { - return reviews.toArray().pop(); - } - - resource function get all() returns table { - return reviews; - } - - resource function get top3() returns Review[] { - return from var review in reviews - limit 3 - select review; - } - - resource function get account() returns AccountRecords { - return {details: {acc1: new ("James", 2022), acc2: new ("Paul", 2015)}}; - } - - resource function subscribe live() returns stream { - return reviews.toArray().toStream(); - } - - resource function subscribe accountUpdates() returns stream { - map details = {acc1: new AccountDetails("James", 2022), acc2: new AccountDetails("Paul", 2015)}; - map updatedDetails = {...details}; - updatedDetails["acc1"] = new AccountDetails("James Deen", 2022); - return [{details}, {details: updatedDetails}].toStream(); - } -} - -isolated service /service_with_http2 on http2BasedListener { - private Person p; - isolated function init() { - self.p = p2.clone(); - } - - isolated resource function get person() returns Person { - lock { - return self.p; - } - } - - isolated remote function setName(string name) returns Person { - lock { - Person p = {name: name, age: self.p.age, address: self.p.address}; - self.p = p; - return self.p; - } - } -} - -graphql:Service subscriptionService = service object { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -}; - -isolated service /service_with_http1 on http1BasedListener { - private Person p; - isolated function init() { - self.p = p2.clone(); - } - - isolated resource function get person() returns Person { - lock { - return self.p; - } - } - - isolated remote function setName(string name) returns Person { - lock { - Person p = {name: name, age: self.p.age, address: self.p.address}; - self.p = p; - return self.p; - } - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@display { - label: "diplay", - id: "display-1" -} -service /annotations on wrappedListener { - resource function get greeting() returns string { - return "Hello"; - } -} - -@graphql:ServiceConfig { - validation: false -} -service /constraints_config on basicListener { - - isolated resource function get movie(MovieDetails movie) returns string { - return movie.name; - } -} - -service /constraints on basicListener { - - private string[] movies; - isolated function init() { - self.movies = []; - } - - isolated resource function get movie(MovieDetails movie) returns string { - return movie.name; - } - - isolated resource function get movies(MovieDetails[] & readonly movies) returns string[] { - return movies.map(m => m.name); - } - - isolated resource function get reviewStars(Reviews[] reviews) returns int[] { - return reviews.map(r => r.stars); - } - - isolated remote function addMovie(MovieDetails movie) returns string { - string name = movie.name; - self.movies.push(name); - return name; - } - - isolated resource function subscribe movie(MovieDetails movie) returns stream { - return movie.reviews.toStream(); - } -} - -service /id_annotation_1 on basicListener { - resource function get student1(@graphql:ID int id1) returns Student1 { - return new Student1(8); - } - - resource function get student2(@graphql:ID float[] id2) returns Student2 { - return new Student2([1.0, 2.0]); - } - - resource function get student3(@graphql:ID uuid:Uuid?[] id3) returns Student3|error { - return new Student3([check uuid:createType1AsRecord()]); - } - - resource function get student4(@graphql:ID int?[]? id4) returns Student4 { - return new Student4([1, 2, (), 4]); - } -} - -public distinct service class Student1 { - final int id; - - function init(int id) { - self.id = id; - } - - resource function get id() returns @graphql:ID int { - return self.id; - } -} - -public distinct service class Student2 { - final float[] id; - - function init(float[] id) { - self.id = id; - } - - resource function get id() returns @graphql:ID float[] { - return self.id; - } -} - -public distinct service class Student3 { - final uuid:Uuid?[] id; - - function init(uuid:Uuid?[] id) { - self.id = id; - } - - resource function get id() returns @graphql:ID uuid:Uuid?[] { - return self.id; - } -} - -public distinct service class Student4 { - final int?[]? id; - - function init(int?[]? id) { - self.id = id; - } - - resource function get id() returns @graphql:ID int?[]? { - return self.id; - } -} - -service /id_annotation_2 on basicListener { - resource function get stringId(@graphql:ID string stringId) returns string { - return "Hello, World"; - } - - resource function get intId(@graphql:ID int intId) returns string { - return "Hello, World"; - } - - resource function get floatId(@graphql:ID float floatId) returns string { - return "Hello, World"; - } - - resource function get decimalId(@graphql:ID decimal decimalId) returns string { - return "Hello, World"; - } - - resource function get stringId1(@graphql:ID string? stringId) returns string { - return "Hello, World"; - } - - resource function get intId1(@graphql:ID int? intId) returns string { - return "Hello, World"; - } - - resource function get floatId1(@graphql:ID float? floatId) returns string { - return "Hello, World"; - } - - resource function get decimalId1(@graphql:ID decimal? decimalId) returns string { - return "Hello, World"; - } - - resource function get intIdReturnRecord(@graphql:ID int intId) returns Student5 { - return new Student5(2, "Jennifer Flackett"); - } - - resource function get intArrayReturnRecord(@graphql:ID int[] intId) returns Student5 { - return new Student5(333, "Antoni Porowski"); - } - - resource function get stringArrayReturnRecord(@graphql:ID string[] stringId) returns Student5 { - return new Student5(212, "Andrew Glouberman"); - } - - resource function get floatArrayReturnRecord(@graphql:ID float[] floatId) returns Student5 { - return new Student5(422, "Elliot Birch"); - } - - resource function get decimalArrayReturnRecord(@graphql:ID decimal[] decimalId) returns Student5 { - return new Student5(452, "Edward MacDell"); - } - - resource function get uuidReturnRecord(@graphql:ID uuid:Uuid uuidId) returns Student5 { - return new Student5(2678, "Abuela Alvarez"); - } - - resource function get uuidArrayReturnRecord(@graphql:ID uuid:Uuid[] uuidId) returns Student5 { - return new Student5(678, "Andy Garcia"); - } - - resource function get uuidArrayReturnRecord1(@graphql:ID uuid:Uuid[]? uuidId) returns Student5 { - return new Student5(563, "Aretha Franklin"); - } - - resource function get stringIdReturnRecord(@graphql:ID string stringId) returns PersonId { - return {id: 543, name: "Marmee March", age: 12}; - } - - resource function get stringArrayReturnRecordArray(@graphql:ID string[] stringIds) returns PersonId[] { - return [ - {id: 789, name: "Beth Match", age: 15}, - {id: 678, name: "Jo March", age: 16}, - {id: 543, name: "Amy March", age: 12} - ]; - } - - resource function get floatArrayReturnRecordArray(@graphql:ID float[] floatIds) returns PersonId[] { - return [ - {id: 789, name: "Beth Match", age: 15}, - {id: 678, name: "Jo March", age: 16}, - {id: 543, name: "Amy March", age: 12} - ]; - } -} - -public type PersonId record {| - @graphql:ID - int id; - string name; - int age; -|}; - -public distinct service class Student5 { - final int id; - final string name; - - function init(int id, string name) { - self.id = id; - self.name = name; - } - - resource function get id() returns @graphql:ID int { - return self.id; - } - - resource function get name() returns string { - return self.name; - } -} - -const AUTHOR_LOADER = "authorLoader"; -const AUTHOR_UPDATE_LOADER = "authorUpdateLoader"; -const BOOK_LOADER = "bookLoader"; - -isolated function initContext(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context ctx = new; - ctx.registerDataLoader(AUTHOR_LOADER, new dataloader:DefaultDataLoader(authorLoaderFunction)); - ctx.registerDataLoader(AUTHOR_UPDATE_LOADER, new dataloader:DefaultDataLoader(authorUpdateLoaderFunction)); - ctx.registerDataLoader(BOOK_LOADER, new dataloader:DefaultDataLoader(bookLoaderFunction)); - return ctx; -} - -@graphql:ServiceConfig { - contextInit: initContext -} -service /dataloader on wrappedListener { - function preAuthors(graphql:Context ctx, int[] ids) { - addAuthorIdsToAuthorLoader(ctx, ids); - } - - resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData[]|error { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); - AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); - return from AuthorRow authorRow in authorRows - select new (authorRow); - } - - function preUpdateAuthorName(graphql:Context ctx, int id, string name) { - [int, string] key = [id, name]; - dataloader:DataLoader authorUpdateLoader = ctx.getDataLoader(AUTHOR_UPDATE_LOADER); - authorUpdateLoader.add(key); - } - - remote function updateAuthorName(graphql:Context ctx, int id, string name) returns AuthorData|error { - [int, string] key = [id, name]; - dataloader:DataLoader authorUpdateLoader = ctx.getDataLoader(AUTHOR_UPDATE_LOADER); - AuthorRow authorRow = check authorUpdateLoader.get(key); - return new (authorRow); - } - - resource function subscribe authors() returns stream { - lock { - readonly & AuthorRow[] authorRows = authorTable.toArray().cloneReadOnly(); - return authorRows.'map(authorRow => new AuthorData(authorRow)).toStream(); - } - } -} - -@graphql:ServiceConfig { - interceptors: new AuthorInterceptor(), - contextInit: initContext -} -service /dataloader_with_interceptor on wrappedListener { - function preAuthors(graphql:Context ctx, int[] ids) { - addAuthorIdsToAuthorLoader(ctx, ids); - } - - resource function get authors(graphql:Context ctx, int[] ids) returns AuthorDetail[]|error { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); - AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); - return from AuthorRow authorRow in authorRows - select new (authorRow); - } -} - -@graphql:ServiceConfig { - interceptors: new AuthorInterceptor(), - contextInit: isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context { - graphql:Context ctx = new; - ctx.registerDataLoader(AUTHOR_LOADER, new dataloader:DefaultDataLoader(faultyAuthorLoaderFunction)); - ctx.registerDataLoader(AUTHOR_UPDATE_LOADER, new dataloader:DefaultDataLoader(authorUpdateLoaderFunction)); - ctx.registerDataLoader(BOOK_LOADER, new dataloader:DefaultDataLoader(bookLoaderFunction)); - return ctx; - } -} -service /dataloader_with_faulty_batch_function on wrappedListener { - function preAuthors(graphql:Context ctx, int[] ids) { - addAuthorIdsToAuthorLoader(ctx, ids); - } - - resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData[]|error { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); - AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); - return from AuthorRow authorRow in authorRows - select new (authorRow); - } -} - -function addAuthorIdsToAuthorLoader(graphql:Context ctx, int[] ids) { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER); - ids.forEach(function(int id) { - authorLoader.add(id); - }); -} - -service /defaultParam on wrappedListener { - resource function get intParam(int a = 1) returns string? => (); - - resource function get floatParam(float b = 2.0) returns string? => (); - - resource function get decimalParam(decimal c = 1e-10) returns string? => (); - - resource function get stringParam(string d = "value") returns string? => (); - - resource function get booleanParam(boolean e = true) returns string? => (); - - resource function get nullableParam(int? f = DEFAULT_INT_VALUE) returns string? => (); - - remote function enumParam(Sex g = MALE) returns string? => (); - - remote function inputObjectParam(InputObject h) returns string? => (); - - remote function inputObjectArrayParam(InputObject[] i = [ - {name: "name2", bmiHistory: [1.0, 2.0]}, - {name: "name3", bmiHistory: [1e-7, 2.0]} - ]) returns string? => (); - - resource function subscribe idArrayParam(@graphql:ID string[] j = ["id1"]) returns stream? => (); - - resource function get multipleParams( - int a = 1, - float b = 2.0, - decimal c = 1e-10, - string d = "value", - boolean e = true, - int? f = DEFAULT_INT_VALUE, - Sex g = MALE, - InputObject h = {name: "name2", bmiHistory: [30.0 , 29.0, 20.0d]}, - InputObject[] i = [ - {name: "name3", bmiHistory: [30.0 , 29.0]}, - {name: "name4", bmiHistory: [2.9e1, 31.0]} - ], - @graphql:ID string[] j = ["id1"]) returns string? => (); - - resource function get nestedField() returns NestedField => new; -} - -class ServiceDeclarationOnObjectField { - - private graphql:Service objectFieldService = service object { - resource function get greeting() returns string { - return "Hello world"; - } - }; - - public function init() {} - - public function getService() returns graphql:Service { - return self.objectFieldService; - } - -} - -service /server_cache on basicListener { - private string name = "Walter White"; - private table key(name) friends = table [ - {name: "Skyler", age: 45, isMarried: true}, - {name: "Walter White Jr.", age: 57, isMarried: true}, - {name: "Jesse Pinkman", age: 23, isMarried: false} - ]; - - private table key(name) enemies = table [ - {name: "Enemy1", age:12, isMarried: false}, - {name: "Enemy2", age:66, isMarried: true}, - {name: "Enemy3", age:33, isMarried: false} - ]; - - isolated resource function get greet() returns string { - return "Hello, " + self.name; - } - - @graphql:ResourceConfig { - cacheConfig: { - enabled: true - } - } - isolated resource function get isAdult(int? age) returns boolean|error { - if age is int { - return age >= 18 ? true: false; - } - return error("Invalid argument type"); - } - - @graphql:ResourceConfig { - cacheConfig: { - enabled: true - } - } - isolated resource function get name(int id) returns string { - return self.name; - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 120 - } - } - isolated resource function get friends(boolean isMarried = false) returns Friend[] { - if isMarried { - return from Friend friend in self.friends - where friend.isMarried == true - select friend; - } - return from Friend friend in self.friends - where friend.isMarried == false - select friend; - } - - isolated resource function get getFriendService(string name) returns FriendService { - Friend[] person = from Friend friend in self.friends - where friend.name == name - select friend; - return new FriendService(person[0].name, person[0].age, person[0].isMarried); - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 180 - } - } - isolated resource function get getFriendServices() returns FriendService[] { - return from Friend friend in self.friends - select new FriendService(friend.name, friend.age, friend.isMarried); - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 180 - } - } - isolated resource function get getServices(boolean isEnemy) returns HumanService[] { - if isEnemy { - return from Friend friend in self.friends - where friend.isMarried == false - select new EnemyService(friend.name, friend.age, friend.isMarried); - } - return from Friend friend in self.friends - where friend.isMarried == true - select new FriendService(friend.name, friend.age, friend.isMarried); - } - - @graphql:ResourceConfig { - cacheConfig: { - maxAge: 120 - } - } - isolated resource function get enemies(boolean? isMarried = ()) returns Enemy[] { - if isMarried is () { - return from Enemy enemy in self.enemies - select enemy; - } - return from Enemy enemy in self.enemies - where enemy.isMarried == isMarried - select enemy; - } - - @graphql:ResourceConfig { - cacheConfig: { - enabled: true - } - } - isolated resource function get isAllMarried(string[] names) returns boolean { - if names is string[] { - foreach string name in names { - if self.enemies.hasKey(name) && !self.enemies.get(name).isMarried { - return false; - } - } - } - return true; - } - - @graphql:ResourceConfig { - cacheConfig: { - enabled: true - } - } - isolated resource function get searchEnemy(EnemyInput enemyInput) returns Enemy? { - if self.enemies.hasKey(enemyInput.name) { - return self.enemies.get(enemyInput.name); - } - return; - } - - isolated remote function updateName(graphql:Context context, string name, boolean enableEvict) returns string|error { - if enableEvict { - check context.invalidate("name"); - } - self.name = name; - return self.name; - } - - isolated remote function updateFriend(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns FriendService|error { - if enableEvict { - check context.invalidateAll(); - } - self.friends.put({name: name, age: age, isMarried: isMarried}); - return new FriendService(name, age, isMarried); - } - - isolated remote function addFriend(string name, int age, boolean isMarried) returns Friend { - Friend friend = {name: name, age: age, isMarried: isMarried}; - self.friends.add(friend); - return friend; - } - - isolated remote function addEnemy(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns Friend|error { - if enableEvict { - check context.invalidate("getServices"); - } - Friend friend = {name: name, age: age, isMarried: isMarried}; - self.friends.add(friend); - return friend; - } - - isolated remote function addEnemy2(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns Enemy|error { - if enableEvict { - check context.invalidate("enemies"); - } - Enemy enemy = {name: name, age: age, isMarried: isMarried}; - self.enemies.add(enemy); - return enemy; - } - - isolated remote function removeEnemy(graphql:Context context, string name, boolean enableEvict) returns Enemy|error { - if enableEvict { - check context.invalidate("enemies"); - } - return self.enemies.remove(name); - } - - isolated remote function updateEnemy(graphql:Context context, EnemyInput enemy, boolean enableEvict) returns Enemy|error { - if enableEvict { - check context.invalidateAll(); - } - Enemy enemyInput = {name: enemy.name, age: enemy.age, isMarried: true}; - self.enemies.put(enemyInput); - return enemyInput; - } -} - -service /evict_server_cache on basicListener { - private string name = "Walter White"; - isolated resource function get greet() returns string { - return "Hello, " + self.name; - } - - @graphql:ResourceConfig { - cacheConfig: { - enabled: true - } - } - isolated resource function get name(int id) returns string { - return self.name; - } - - isolated remote function updateName(graphql:Context context, string name) returns string|error { - check context.invalidate("name"); - self.name = name; - return self.name; - } -} - -@graphql:ServiceConfig { - cacheConfig: { - enabled: true, - maxAge: 20, - maxSize: 15 - }, - contextInit: initContext -} -service /server_cache_operations on basicListener { - private string name = "Walter White"; - private table key(name) friends = table [ - {name: "Skyler", age: 45, isMarried: true}, - {name: "Walter White Jr.", age: 57, isMarried: true}, - {name: "Jesse Pinkman", age: 23, isMarried: false} - ]; - - private table key(name) associates = table [ - {name: "Gus Fring", status: "dead"}, - {name: "Tuco Salamanca", status: "dead"}, - {name: "Saul Goodman", status: "alive"} - ]; - - isolated resource function get greet() returns string { - return "Hello, " + self.name; - } - - isolated resource function get name(int id) returns string { - return self.name; - } - - isolated resource function get friends(boolean isMarried = false) returns Friend[] { - if isMarried { - return from Friend friend in self.friends - where friend.isMarried == true - select friend; - } - return from Friend friend in self.friends - where friend.isMarried == false - select friend; - } - - isolated resource function get getFriendService(string name) returns FriendService|error { - Friend[] person = from Friend friend in self.friends - where friend.name == name - select friend; - if person != [] { - return new FriendService(person[0].name, person[0].age, person[0].isMarried); - } else { - return error(string `No person found with the name: ${name}`); - } - } - - isolated resource function get getAssociateService(string name) returns AssociateService { - Associate[] person = from Associate associate in self.associates - where associate.name == name - select associate; - return new AssociateService(person[0].name, person[0].status); - } - - isolated resource function get relationship(string name) returns Relationship { - (Associate|Friend)[] person = from Associate associate in self.associates - where associate.name == name - select associate; - if person.length() == 0 { - person = from Friend friend in self.friends - where friend.name == name - select friend; - return new FriendService(person[0].name, (person[0]).age, (person[0]).isMarried); - } - return new AssociateService(person[0].name, (person[0]).status); - } - - isolated resource function get getFriendServices() returns FriendService[] { - return from Friend friend in self.friends - select new FriendService(friend.name, friend.age, friend.isMarried); - } - - isolated resource function get getAllFriendServices(graphql:Context context, boolean enableEvict) returns FriendService[]|error { - if enableEvict { - check context.invalidateAll(); - } - return from Friend friend in self.friends - select new FriendService(friend.name, friend.age, friend.isMarried); - } - - isolated remote function updateName(graphql:Context context, string name, boolean enableEvict) returns string|error { - if enableEvict { - check context.invalidateAll(); - } - self.name = name; - return self.name; - } - - isolated remote function updateFriend(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns FriendService|error { - if enableEvict { - check context.invalidateAll(); - } - self.friends.put({name: name, age: age, isMarried: isMarried}); - return new FriendService(name, age, isMarried); - } - - isolated remote function updateAssociate(graphql:Context context, string name, string status, boolean enableEvict) returns AssociateService|error { - if enableEvict { - check context.invalidateAll(); - } - self.associates.put({name: name, status: status}); - return new AssociateService(name, status); - } - - isolated remote function addFriend(graphql:Context context, string name, int age, boolean isMarried, boolean enableEvict) returns Friend|error { - if enableEvict { - check context.invalidate("getFriendService"); - check context.invalidate("getAllFriendServices"); - check context.invalidate("friends"); - } - Friend friend = {name: name, age: age, isMarried: isMarried}; - self.friends.add(friend); - return friend; - } - - resource function get status(Associate[]? associates) returns string[]? { - if associates is Associate[] { - return associates.map(associate => associate.status); - } - return; - } -} - -const AUTHOR_LOADER_2 = "authorLoader2"; -const BOOK_LOADER_2 = "bookLoader2"; - -isolated function initContext2(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context ctx = new; - ctx.registerDataLoader(AUTHOR_LOADER_2, new dataloader:DefaultDataLoader(authorLoaderFunction2)); - ctx.registerDataLoader(BOOK_LOADER_2, new dataloader:DefaultDataLoader(bookLoaderFunction2)); - return ctx; -} - -function addAuthorIdsToAuthorLoader2(graphql:Context ctx, int[] ids) { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER_2); - ids.forEach(function(int id) { - authorLoader.add(id); - }); -} - -@graphql:ServiceConfig { - contextInit: initContext2 -} -service /caching_with_dataloader on wrappedListener { - function preAuthors(graphql:Context ctx, int[] ids) { - addAuthorIdsToAuthorLoader2(ctx, ids); - } - - @graphql:ResourceConfig { - cacheConfig:{ - enabled: true - } - } - resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData2[]|error { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER_2); - AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); - return from AuthorRow authorRow in authorRows - select new (authorRow); - } - - isolated remote function updateAuthorName(graphql:Context ctx, int id, string name, boolean enableEvict = false) returns AuthorData2|error { - if enableEvict { - check ctx.invalidate("authors"); - } - AuthorRow authorRow = {id: id, name}; - lock { - authorTable2.put(authorRow.cloneReadOnly()); - } - return new (authorRow); - } -} - -@graphql:ServiceConfig { - cacheConfig:{ - enabled: true - }, - contextInit: initContext2 -} -service /caching_with_dataloader_operational on wrappedListener { - function preAuthors(graphql:Context ctx, int[] ids) { - addAuthorIdsToAuthorLoader2(ctx, ids); - } - - resource function get authors(graphql:Context ctx, int[] ids) returns AuthorData2[]|error { - dataloader:DataLoader authorLoader = ctx.getDataLoader(AUTHOR_LOADER_2); - AuthorRow[] authorRows = check trap ids.map(id => check authorLoader.get(id, AuthorRow)); - return from AuthorRow authorRow in authorRows - select new (authorRow); - } - - isolated remote function updateAuthorName(graphql:Context ctx, int id, string name, boolean enableEvict = false) returns AuthorData2|error { - if enableEvict { - check ctx.invalidate("authors"); - } - AuthorRow authorRow = {id: id, name}; - lock { - authorTable2.put(authorRow.cloneReadOnly()); - } - return new (authorRow); - } -} - -service /field_caching_with_interceptors on basicListener { - private string enemy = "voldemort"; - private string friend = "Harry"; - - @graphql:ResourceConfig { - interceptors: [new StringInterceptor1(), new StringInterceptor2(), new StringInterceptor3()], - cacheConfig:{ - enabled: true, - maxAge: 15 - } - } - resource function get enemy() returns string { - return self.enemy; - } - - @graphql:ResourceConfig { - cacheConfig:{ - enabled: true, - maxAge: 10 - } - } - resource function get friend() returns string { - return self.friend; - } - - remote function updateEnemy(graphql:Context context, string name, boolean enableEvict) returns string|error { - if enableEvict { - check context.invalidate("enemy"); - } - self.enemy = name; - return self.enemy; - } - - remote function updateFriend(string name) returns string|error { - self.friend = name; - return self.friend; - } -} - -@graphql:ServiceConfig { - cacheConfig:{ - enabled: true - } -} -service /caching_with_interceptor_operations on basicListener { - private string name = "voldemort"; - - @graphql:ResourceConfig { - interceptors: [new StringInterceptor1(), new StringInterceptor2(), new StringInterceptor3()] - } - resource function get enemy() returns string { - return self.name; - } - - remote function updateEnemy(graphql:Context context, string name, boolean enableEvict) returns string|error { - if enableEvict { - check context.invalidate("enemy"); - } - self.name = name; - return self.name; - } -} - -service /dynamic_response on basicListener { - private User user = {id: 1, name: "John", age: 25}; - - @graphql:ResourceConfig { - cacheConfig: { - enabled: true, - maxAge: 600 - } - } - resource function get user(graphql:Field 'field, int id) returns User { - string[] sub = 'field.getSubfieldNames(); - if sub.length() == 1 { - return {id: self.user.id}; - }else if sub.length() == 2 { - return {id: self.user.id, name: self.user.name}; - } else { - return self.user; - } - } - - remote function updateUser(graphql:Context context, int id, string name, int age, boolean enableEvict) returns User|error { - if enableEvict { - check context.invalidate("user"); - } - self.user = {id:id, name:name, age:age}; - return self.user; - } -} - -@graphql:ServiceConfig { - cacheConfig: { - maxAge: 600 - } -} -service /cache_with_list_input on basicListener { - private User user1 = {id: 1, name: "John", age: 25}; - private User user2 = {id: 2, name: "Jessie", age: 17}; - private Address[] addresses = []; - - resource function get users1(int[] ids) returns User[] { - if ids.length() == 1 && ids[0] == 1 { - return [self.user1]; - } else if ids.length() == 1 && ids[0] == 2 { - return [self.user2]; - } - return [self.user1, self.user2]; - } - - resource function get users2(int[][] ids) returns User[] { - if ids.length() == 3 && ids[0][0] == 1 { - return [self.user1]; - } else if ids.length() == 3 && ids[0][0] == 2 || ids[0][0] == 3 { - return [self.user2]; - } - return [self.user1, self.user2]; - } - - resource function get cities(Address[] addresses) returns string[] { - self.addresses.push(...addresses); - return self.addresses.map(address => address.city); - } - - remote function updateUser(int id, string name, int age) returns User|error { - self.user1 = {id:id, name:name, age:age}; - return self.user1; - } - - remote function updateAddress(Address address) returns Address { - self.addresses.push(address); - return address; - } -} - - -@graphql:ServiceConfig { - cacheConfig: { - maxSize: 5 - } -} -service /server_cache_records_with_non_optional on basicListener { - private table profiles = table [ - {name: "John", age: 30, contact: "0123456789"}, - {name: "Doe", age: 25, contact: "9876543210"}, - {name: "Jane", age: 35, contact: "1234567890"} - ]; - - resource function get profiles() returns ProfileInfo[] { - return self.profiles.toArray(); - } - - remote function removeProfiles(graphql:Context ctx, boolean enableEvict) returns ProfileInfo[]|error { - if enableEvict { - check ctx.invalidateAll(); - } - ProfileInfo[] profiles = self.profiles.toArray(); - self.profiles.removeAll(); - return profiles; - } -} - diff --git a/build-config/resources/BallerinaTest.toml b/build-config/resources/BallerinaTest.toml index ae7b18831..00ff1f2ae 100644 --- a/build-config/resources/BallerinaTest.toml +++ b/build-config/resources/BallerinaTest.toml @@ -1,7 +1,10 @@ [package] org = "ballerina" -name = "graphql_tests" +name = "@package.name@" version = "@toml.version@" -[build-options] -observabilityIncluded = true +[[dependency]] +org = "ballerina" +name = "@test.common@" +repository = "local" +version = "@toml.version@" diff --git a/build-config/resources/BallerinaTestCommon.toml b/build-config/resources/BallerinaTestCommon.toml new file mode 100644 index 000000000..91de9a783 --- /dev/null +++ b/build-config/resources/BallerinaTestCommon.toml @@ -0,0 +1,4 @@ +[package] +org = "ballerina" +name = "@package.name@" +version = "@toml.version@" From 7113ff3f1c015db679acc52202c8e90c95c94500 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 10:15:35 +0530 Subject: [PATCH 03/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index a18282fd3..11a402bef 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -113,7 +113,8 @@ dependencies = [ {org = "ballerina", name = "websocket"} ] modules = [ - {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"} + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"}, + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"} ] [[package]] From 3b95e8d005c689d2d38a714b62827abf8624e1e1 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 10:41:51 +0530 Subject: [PATCH 04/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index 11a402bef..6a57592fd 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -114,7 +114,8 @@ dependencies = [ ] modules = [ {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"}, - {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"} + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"}, + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.two"} ] [[package]] From 8e0df5f6fb2e3a3836bbe84663c31ee59de14dfc Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 11:43:26 +0530 Subject: [PATCH 05/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index 6a57592fd..c3806c728 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -108,6 +108,7 @@ dependencies = [ {org = "ballerina", name = "graphql"}, {org = "ballerina", name = "graphql_test_common"}, {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "test"}, {org = "ballerina", name = "websocket"} @@ -177,6 +178,9 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] +modules = [ + {org = "ballerina", packageName = "io", moduleName = "io"} +] [[package]] org = "ballerina" From b2f3ce8fffd923ebff4cb082c039dedf5cfcbce6 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 13:04:50 +0530 Subject: [PATCH 06/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index c3806c728..6a57592fd 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -108,7 +108,6 @@ dependencies = [ {org = "ballerina", name = "graphql"}, {org = "ballerina", name = "graphql_test_common"}, {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, {org = "ballerina", name = "lang.runtime"}, {org = "ballerina", name = "test"}, {org = "ballerina", name = "websocket"} @@ -178,9 +177,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] -modules = [ - {org = "ballerina", packageName = "io", moduleName = "io"} -] [[package]] org = "ballerina" From 8775cf67ed07de603a844583a228e20571f1eda4 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 13:22:15 +0530 Subject: [PATCH 07/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index 6a57592fd..06beb4701 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -115,6 +115,7 @@ dependencies = [ modules = [ {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"}, + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.three"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.two"} ] From 7f0b5af36fa857abdbe2fb5e7707055c2c977200 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 13:39:29 +0530 Subject: [PATCH 08/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index 06beb4701..8a07c12d3 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -114,6 +114,7 @@ dependencies = [ ] modules = [ {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"}, + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.four"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.three"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.two"} From 78757f94f02d686ac2cf3085c1c8c6109ce5a733 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 13:46:30 +0530 Subject: [PATCH 09/15] [Automated] Update the native jar versions --- .../graphql-subscription-test-suite/Dependencies.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index 8a07c12d3..9755e6198 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -114,6 +114,7 @@ dependencies = [ ] modules = [ {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite"}, + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.five"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.four"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.three"}, From 5d427859c145d54de7bbba72e681d7b00376487d Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 14:24:28 +0530 Subject: [PATCH 10/15] Split subscription test suite into sub-modules --- .../tests/01_dataloader_tests.bal | 2 +- .../tests/values.bal | 2 - .../tests/01_interceptor_tests.bal | 16 +- .../tests/values.bal | 2 - .../tests/values.bal | 1 - .../five/tests/01_subscription_five_tests.bal | 54 ++ .../tests/02_subscription_with_context.bal | 8 +- .../tests/03_subscription_with_constraint.bal | 4 +- .../modules/five/tests/listeners.bal | 23 + .../modules/five/tests/object_types.bal | 45 ++ .../{ => modules/five}/tests/records.bal | 15 - .../modules/five/tests/services.bal | 73 +++ .../four/tests/01_subscription_four_tests.bal | 163 +++++ .../modules/four/tests/listeners.bal | 20 + .../modules/four/tests/object_types.bal | 25 + .../modules/four/tests/services.bal | 26 + .../one/tests/01_subscription_tests.bal | 156 +++++ .../modules/one/tests/listeners.bal | 19 + .../modules/one/tests/object_types.bal | 75 +++ .../modules/one/tests/records.bal | 30 + .../modules/one/tests/services.bal | 65 ++ .../modules/one/tests/values.bal | 17 + .../tests/01_subscription_three_tests.bal | 169 +++++ .../{ => modules/three}/tests/listeners.bal | 3 - .../three}/tests/object_types.bal | 83 --- .../modules/three/tests/records.bal | 40 ++ .../modules/three/tests/services.bal | 59 ++ .../{ => modules/three}/tests/values.bal | 4 - .../two/tests/01_subscription_two_tests.bal | 152 +++++ .../modules/two/tests/listeners.bal | 19 + .../modules/two/tests/object_types.bal | 33 + .../modules/two/tests/services.bal | 37 ++ .../tests/01_subscription_tests.bal | 616 ------------------ .../tests/services.bal | 156 ----- .../graphql-test-common/constants.bal | 2 + 35 files changed, 1317 insertions(+), 897 deletions(-) create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal rename ballerina-tests/graphql-subscription-test-suite/{ => modules/five}/tests/02_subscription_with_context.bal (91%) rename ballerina-tests/graphql-subscription-test-suite/{ => modules/five}/tests/03_subscription_with_constraint.bal (92%) create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/five/tests/listeners.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/five/tests/object_types.bal rename ballerina-tests/graphql-subscription-test-suite/{ => modules/five}/tests/records.bal (84%) create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/five/tests/services.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/four/tests/listeners.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/four/tests/object_types.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/four/tests/services.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/one/tests/listeners.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/one/tests/object_types.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/one/tests/records.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/one/tests/services.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/one/tests/values.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal rename ballerina-tests/graphql-subscription-test-suite/{ => modules/three}/tests/listeners.bal (87%) rename ballerina-tests/graphql-subscription-test-suite/{ => modules/three}/tests/object_types.bal (50%) create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/three/tests/records.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/three/tests/services.bal rename ballerina-tests/graphql-subscription-test-suite/{ => modules/three}/tests/values.bal (90%) create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/two/tests/listeners.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/two/tests/object_types.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/two/tests/services.bal delete mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal delete mode 100644 ballerina-tests/graphql-subscription-test-suite/tests/services.bal diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal index c47848cf9..17bc71db8 100644 --- a/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal @@ -53,7 +53,7 @@ isolated function testDataLoaderWithDifferentAliasForSameField() returns error? } isolated function testDataLoaderWithSubscription() returns error? { string document = check common:getGraphqlDocumentFromFile("dataloader_with_subscription"); - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient = check new ("ws://localhost:9090/dataloader", config); check common:initiateGraphqlWsConnection(wsClient); check common:sendSubscriptionMessage(wsClient, document, "1"); diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal index 3d9eca5d5..61e68d28b 100644 --- a/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/values.bal @@ -14,8 +14,6 @@ // specific language governing permissions and limitations // under the License. -const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; - const AUTHOR_LOADER = "authorLoader"; const AUTHOR_UPDATE_LOADER = "authorUpdateLoader"; const BOOK_LOADER = "bookLoader"; diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal index 9bade9db4..667244c85 100644 --- a/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal @@ -97,7 +97,7 @@ function dataProviderInterceptors() returns string[][] { isolated function testInterceptorsWithSubscriptionReturningScalar() returns error? { string document = string `subscription { messages }`; string url = "ws://localhost:9091/subscription_interceptor1"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, "1"); @@ -119,7 +119,7 @@ isolated function testInterceptorsWithSubscriptionReturningScalar() returns erro isolated function testInterceptorsWithSubscriptionReturningRecord() returns error? { string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_records"); string url = "ws://localhost:9091/subscription_interceptor2"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, operationName = "A"); @@ -141,7 +141,7 @@ isolated function testInterceptorsWithSubscriptionReturningRecord() returns erro isolated function testInterceptorsWithSubscriptionAndFragments() returns error? { string document = check common:getGraphqlDocumentFromFile("interceptors_with_fragments_and_subscription"); string url = "ws://localhost:9091/subscription_interceptor3"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, operationName = "getStudents"); @@ -163,7 +163,7 @@ isolated function testInterceptorsWithSubscriptionAndFragments() returns error? isolated function testInterceptorsWithUnionTypeSubscription() returns error? { string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); string url = "ws://localhost:9091/subscription_interceptor4"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, operationName = "unionTypes1"); @@ -206,7 +206,7 @@ isolated function testInterceptorsWithUnionTypeSubscription() returns error? { isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns error? { string document = string `subscription { messages }`; string url = "ws://localhost:9091/subscription_interceptor5"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, "1"); @@ -228,7 +228,7 @@ isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns isolated function testInterceptorsDestructiveModificationWithSubscription() returns error? { string document = string `subscription { messages }`; string url = "ws://localhost:9091/subscription_interceptor6"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, "1"); @@ -276,7 +276,7 @@ isolated function testInterceptorsDestructiveModificationWithSubscription() retu isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns error? { final string document = string `subscription { messages }`; string url = "ws://localhost:9091/subscription_interceptor1"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; final websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); @@ -315,7 +315,7 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns er isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns error? { final string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); string url = "ws://localhost:9091/subscription_interceptor4"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; final websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal index 438e4e88f..c6167bf96 100644 --- a/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/values.bal @@ -14,8 +14,6 @@ // specific language governing permissions and limitations // under the License. -const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; - final readonly & Person p2 = { name: "Walter White", age: 50, diff --git a/ballerina-tests/graphql-service-test-suite/tests/values.bal b/ballerina-tests/graphql-service-test-suite/tests/values.bal index 4fbb65706..24fba3447 100644 --- a/ballerina-tests/graphql-service-test-suite/tests/values.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/values.bal @@ -258,7 +258,6 @@ final readonly & TaskTable tasks = table [ ]; // WebSocket Sub Protocols -const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; const WS_SUB_PROTOCOL = "Sec-WebSocket-Protocol"; const int DEFAULT_INT_VALUE = 20; diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal new file mode 100644 index 000000000..e8b26a43a --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal @@ -0,0 +1,54 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["listener", "subscriptions"] +} +function testAttachServiceWithSubscriptionToHttp2BasedListener() returns error? { + graphql:Error? result = http2BasedListener.attach(subscriptionService); + test:assertTrue(result is graphql:Error); + graphql:Error err = result; + string expecctedMessage = string `Websocket listener initialization failed due to the incompatibility of ` + + string `provided HTTP(version 2.0) listener`; + test:assertEquals(err.message(), expecctedMessage); +} + +@test:Config { + groups: ["listener", "subscriptions"] +} +function testAttachServiceWithSubscriptionToHttp1BasedListener() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/service_with_http1"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal similarity index 91% rename from ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal rename to ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal index 5bb1a8c1c..76b55fcc6 100644 --- a/ballerina-tests/graphql-subscription-test-suite/tests/02_subscription_with_context.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal @@ -22,13 +22,13 @@ import ballerina/websocket; groups: ["context", "subscriptions"] } isolated function testContextWithSubscriptions() returns error? { - string url = "ws://localhost:9092/context"; + string url = "ws://localhost:9091/context"; string document = string `subscription { messages }`; websocket:ClientConfiguration configs = { customHeaders: { "scope": "admin" }, - subProtocols: [GRAPHQL_TRANSPORT_WS] + subProtocols: [common:GRAPHQL_TRANSPORT_WS] }; websocket:Client wsClient = check new (url, configs); check common:initiateGraphqlWsConnection(wsClient); @@ -43,13 +43,13 @@ isolated function testContextWithSubscriptions() returns error? { groups: ["context", "subscriptions"] } isolated function testContextWithInvalidScopeInSubscriptions() returns error? { - string url = "ws://localhost:9092/context"; + string url = "ws://localhost:9091/context"; string document = string `subscription { messages }`; websocket:ClientConfiguration configs = { customHeaders: { "scope": "user" }, - subProtocols: [GRAPHQL_TRANSPORT_WS] + subProtocols: [common:GRAPHQL_TRANSPORT_WS] }; websocket:Client wsClient = check new (url, configs); check common:initiateGraphqlWsConnection(wsClient); diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal similarity index 92% rename from ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal rename to ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal index b60bfb8d5..752b0a158 100644 --- a/ballerina-tests/graphql-subscription-test-suite/tests/03_subscription_with_constraint.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal @@ -24,7 +24,7 @@ import ballerina/websocket; isolated function testSubscriptionWithConstraints() returns error? { string document = check common:getGraphqlDocumentFromFile("constraints"); string url = "ws://localhost:9091/constraints"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient = check new (url, config); check common:initiateGraphqlWsConnection(wsClient); check common:sendSubscriptionMessage(wsClient, document, operationName = "Sub"); @@ -38,7 +38,7 @@ isolated function testSubscriptionWithConstraints() returns error? { isolated function testMultipleSubscriptionClientsWithConstraints() returns error? { string document = check common:getGraphqlDocumentFromFile("constraints"); string url = "ws://localhost:9091/constraints"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; websocket:Client wsClient1 = check new (url, config); check common:initiateGraphqlWsConnection(wsClient1); check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "Sub"); diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/listeners.bal new file mode 100644 index 000000000..bcd752de9 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/listeners.bal @@ -0,0 +1,23 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +listener http:Listener http2Listener = new http:Listener(9090); +listener graphql:Listener http2BasedListener = new (http2Listener); + +listener graphql:Listener subscriptionListener = new (9091); diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/object_types.bal new file mode 100644 index 000000000..b82b083cd --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/object_types.bal @@ -0,0 +1,45 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public service class AccountDetails { + final string name; + final int createdYear; + + function init(string name, int createdYear) { + self.name = name; + self.createdYear = createdYear; + } + + resource function get name() returns string { + return self.name; + } + + resource function get createdYear() returns int { + return self.createdYear; + } +} + +public service class Product { + private final string id; + + function init(string id) { + self.id = id; + } + + resource function get id() returns string { + return self.id; + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/records.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/records.bal similarity index 84% rename from ballerina-tests/graphql-subscription-test-suite/tests/records.bal rename to ballerina-tests/graphql-subscription-test-suite/modules/five/tests/records.bal index 41377d84f..d9809cb09 100644 --- a/ballerina-tests/graphql-subscription-test-suite/tests/records.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/records.bal @@ -52,21 +52,6 @@ public type Reviews readonly & record {| int stars; |}; -public type Review record {| - Product product; - int score; - string description; -|}; - -public type AccountRecords record {| - map details; -|}; - -public type Book readonly & record { - string name; - string author; -}; - public enum Weekday { SUNDAY, MONDAY, diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/services.bal new file mode 100644 index 000000000..b44724439 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/services.bal @@ -0,0 +1,73 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; +import ballerina/http; + +graphql:Service subscriptionService = service object { + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +}; + +isolated service /service_with_http1 on subscriptionListener { + isolated resource function get greet() returns string { + return "welcome!"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + contextInit: + isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { + graphql:Context context = new; + context.set("scope", check request.getHeader("scope")); + return context; + } +} +service /context on subscriptionListener { + isolated resource function get greet() returns string { + return "welcome!"; + } + + isolated resource function subscribe messages(graphql:Context context) returns stream|error { + var scope = context.get("scope"); + if scope is string && scope == "admin" { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } + return error("You don't have permission to retrieve data"); + } +} + +service /constraints on subscriptionListener { + isolated resource function get greet() returns string { + return "welcome!"; + } + + isolated resource function subscribe movie(MovieDetails movie) returns stream { + return movie.reviews.toStream(); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal new file mode 100644 index 000000000..0ee7a148f --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal @@ -0,0 +1,163 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["subscriptions", "multiplexing"] +} +isolated function testSubscriptionMultiplexing() returns error? { + string document = string `subscription { refresh }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, "1"); + check common:sendSubscriptionMessage(wsClient, document, "2"); + + boolean subscriptionOneDisabled = false; + map subscriptions = {"1": 0, "2": 0}; + while true { + json actualPayload = check common:readMessageExcludingPingMessages(wsClient); + string subscriptionId = check actualPayload.id; + subscriptions[subscriptionId] = subscriptions.get(subscriptionId) + 1; + if subscriptionOneDisabled && subscriptionId == "1" { + test:assertFail("Subscription one already unsubscirbed. No further data should be sent by ther server."); + } + if subscriptionId == "1" && subscriptions.get(subscriptionId) == 3 { + subscriptionOneDisabled = true; + check wsClient->writeMessage({'type: common:WS_COMPLETE, id: subscriptionId}); + } + if subscriptionId == "2" && subscriptions.get(subscriptionId) == 10 { + check wsClient->writeMessage({'type: common:WS_COMPLETE, id: subscriptionId}); + break; + } + json payload = {data: {refresh: "data"}}; + json expectedPayload = {'type: common:WS_NEXT, id: subscriptionId, payload: payload}; + test:assertEquals(actualPayload, expectedPayload); + } +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketRequestWithEmptyQuery() returns error? { + string document = ""; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + json expectedMsgPayload = {errors: [{message: "An empty query is found"}]}; + check common:validateErrorMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json payload = {query: 2}; + check wsClient->writeMessage({"type": common:WS_SUBSCRIBE, id: "1", payload: payload}); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketRequestWithoutQuery() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check wsClient->writeMessage({"type": common:WS_SUBSCRIBE, id: "1", payload: {}}); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidVariableInWebSocketPayload() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_variable_values"); + json variables = []; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, variables = variables); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testEmptyWebSocketPayload() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + string payload = ""; + check wsClient->writeMessage(payload); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["request_validation", "websocket", "subscriptions"] +} +isolated function testInvalidWebSocketPayload() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:Client wsClient = check new (url, {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}); + json payload = {payload: {query: ()}}; + check wsClient->writeMessage(payload); + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions", "recrods", "service"] +} +isolated function testConnectionClousureWhenPongNotRecived() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json|error response; + while true { + response = wsClient->readMessage(); + if response is json { + test:assertTrue(response.'type == common:WS_PING); + continue; + } + break; + } + test:assertTrue(response is error, "Expected connection clousure error"); + test:assertEquals((response).message(), "Request timeout: Status code: 4408"); +} + diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/listeners.bal new file mode 100644 index 000000000..22087e2e4 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/listeners.bal @@ -0,0 +1,20 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener subscriptionListener = new (9091); + diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/object_types.bal new file mode 100644 index 000000000..0e3ab3996 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/object_types.bal @@ -0,0 +1,25 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/lang.runtime; + +class RefreshData { + public isolated function next() returns record {|string value;|}? { + // emit data every one second + runtime:sleep(1); + return {value: "data"}; + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/services.bal new file mode 100644 index 000000000..8351ec5b4 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/services.bal @@ -0,0 +1,26 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +service /subscriptions on subscriptionListener { + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe refresh() returns stream { + RefreshData dataRefersher = new; + return new (dataRefersher); + } +} \ No newline at end of file diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal new file mode 100644 index 000000000..8cf319786 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal @@ -0,0 +1,156 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscription() returns error? { + string document = string `subscription { name }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {name: "Walter"}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {name: "Skyler"}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionWithoutSubProtocol() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:Client|error wsClient = new (url); + string expectedErrorMsg = "InvalidHandshakeError: Invalid handshake response getStatus: 400 Bad Request"; + test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); + test:assertEquals((wsClient).message(), expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionsWithMultipleOperations() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_multiple_operations"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "getMessages"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "getStringMessages"); + + json expectedMsgPayload = {data: null}; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + foreach int i in 1 ..< 4 { + expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + expectedMsgPayload = {data: {stringMessages: i.toString()}}; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } + string httpUrl = "http://localhost:9091/subscriptions"; + json actualPayload = check common:getJsonPayloadFromService(httpUrl, document, operationName = "getName"); + json expectedPayload = {data: {name: "Walter White"}}; + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["records", "subscriptions"] +} +isolated function testSubscriptionWithRecords() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_records"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testQueryWithSameSubscriptionFieldName() returns error? { + string document = string `query { name }`; + string url = "http://localhost:9091/subscriptions"; + json actualPayload = check common:getJsonPayloadFromService(url, document); + json expectedPayload = {data: {name: "Walter White"}}; + common:assertJsonValuesWithOrder(actualPayload, expectedPayload); +} + +@test:Config { + groups: ["fragments", "subscriptions"] +} +isolated function testSubscriptionWithFragments() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_fragments"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["union", "subscriptions"] +} +isolated function testSubscriptionWithUnionType() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_union_type"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {multipleValues: {id: 1, name: "Jesse Pinkman"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {multipleValues: {name: "Walter White", subject: "Chemistry"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["variables", "subscriptions"] +} +isolated function testSubscriptionWithVariables() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_variable_values"); + json variables = {"value": 4}; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, variables = variables); + + foreach int i in 1 ..< 3 { + json expectedMsgPayload = {data: {filterValues: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/listeners.bal new file mode 100644 index 000000000..046624e3c --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/listeners.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener subscriptionListener = new (9091); diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/object_types.bal new file mode 100644 index 000000000..a384679a5 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/object_types.bal @@ -0,0 +1,75 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public type PeopleService StudentService|TeacherService; + +public distinct isolated service class StudentService { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } +} + +public distinct isolated service class TeacherService { + private final int id; + private string name; + private string subject; + + public isolated function init(int id, string name, string subject) { + self.id = id; + self.name = name; + self.subject = subject; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + isolated function setName(string name) { + lock { + self.name = name; + } + } + + isolated resource function get subject() returns string { + lock { + return self.subject; + } + } + + isolated function setSubject(string subject) { + lock { + self.subject = subject; + } + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/records.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/records.bal new file mode 100644 index 000000000..c6941a991 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/records.bal @@ -0,0 +1,30 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public type Book readonly & record { + string name; + string author; +}; + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/services.bal new file mode 100644 index 000000000..ce4ccf063 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/services.bal @@ -0,0 +1,65 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +service /subscriptions on subscriptionListener { + isolated resource function get name() returns string { + return "Walter White"; + } + + resource function subscribe name() returns stream { + return namesArray.toStream(); + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } + + isolated resource function subscribe stringMessages() returns stream { + string?[] stringArray = [(), "1", "2", "3", "4", "5"]; + return stringArray.toStream(); + } + + isolated resource function subscribe books() returns stream { + Book[] books = [ + {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, + {name: "A Game of Thrones", author: "George R.R. Martin"} + ]; + return books.toStream(); + } + + isolated resource function subscribe students() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } + + isolated resource function subscribe filterValues(int value) returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + int[] filteredArray = []; + foreach int i in intArray { + if i < value { + filteredArray.push(i); + } + } + return filteredArray.toStream(); + } + + isolated resource function subscribe multipleValues() returns stream<(PeopleService)>|error { + StudentService s = new StudentService(1, "Jesse Pinkman"); + TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); + return [s, t].toStream(); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/values.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/values.bal new file mode 100644 index 000000000..364d89c82 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/values.bal @@ -0,0 +1,17 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public string[] namesArray = ["Walter", "Skyler"]; diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal new file mode 100644 index 000000000..ecade6828 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal @@ -0,0 +1,169 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["subscriptions"] +} +function testAlreadyExistingSubscriber() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + string clientId = wsClient.getConnectionId(); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document, clientId); + check common:sendSubscriptionMessage(wsClient, document, clientId); + string expectedErrorMsg = "Subscriber for " + clientId + " already exists: Status code: 4409"; + int i = 0; + json|error response; + while true { + i += 1; + response = common:readMessageExcludingPingMessages(wsClient); + if response is error { + break; + } + if i > 3 { + test:assertFail(string `Expected: ${expectedErrorMsg}, Found: ${response.toString()}`); + } + json|error id = response.id; + if id is error { + test:assertFail(string `Expected json with id found: ${response.toString()}`); + } + } + test:assertEquals((response).message(), expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testOnPing() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check wsClient->writeMessage({'type: common:WS_PING}); + json response = check wsClient->readMessage(); + test:assertEquals(response.'type, common:WS_PONG); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testInvalidSubProtocolInSubscriptions() returns error? { + string url = "ws://localhost:9091/subscriptions"; + string subProtocol = "graphql-invalid-ws"; + websocket:ClientConfiguration config = {subProtocols: [subProtocol]}; + websocket:Client|error wsClient = new (url, config); + test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); + string expectedErrorMsg = "InvalidHandshakeError: Invalid subprotocol. Actual: null." + + " Expected one of: graphql-invalid-ws"; + test:assertEquals((wsClient).message(), expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions", "runtime_errors"] +} +isolated function testErrorsInStreams() returns error? { + string document = "subscription { evenNumber }"; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {evenNumber: 2}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = check common:getJsonContentFromFile("errors_in_streams"); + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {evenNumber: 6}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testMultipleSubscriptionUsingSingleClient() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + + check common:sendSubscriptionMessage(wsClient, document, "1"); + foreach int i in 1 ..< 6 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload, id = "1"); + } + check common:validateCompleteMessage(wsClient, id = "1"); + + check common:sendSubscriptionMessage(wsClient, document, "2"); + foreach int i in 1 ..< 6 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient, expectedMsgPayload, id = "2"); + } + check common:validateCompleteMessage(wsClient, id = "2"); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionWithInvalidPayload() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json invalidPayload = {'type: "start"}; + check wsClient->writeMessage(invalidPayload); + + string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + + " 'graphql-transport-ws' subprotocol: Status code: 1003"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions", "recrods", "service"] +} +isolated function testResolverReturingStreamOfRecordsWithServiceObjects() returns error? { + string document = "subscription { live { product { id } score } }"; + string url = "ws://localhost:9092/reviews"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedPayload = {data: {live: {product: {id: "1"}, score: 20}}}; + check common:validateNextMessage(wsClient, expectedPayload); +} + +@test:Config { + groups: ["subscriptions", "recrods", "service", "maps"] +} +isolated function testResolverReturingStreamOfRecordsWithMapOfServiceObjects() returns error? { + string document = string `subscription { accountUpdates { details(key: "acc1") { name } } }`; + string url = "ws://localhost:9092/reviews"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {accountUpdates: {details: {name: "James"}}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {accountUpdates: {details: {name: "James Deen"}}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/listeners.bal similarity index 87% rename from ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal rename to ballerina-tests/graphql-subscription-test-suite/modules/three/tests/listeners.bal index b9fc1c816..2374aa6f9 100644 --- a/ballerina-tests/graphql-subscription-test-suite/tests/listeners.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/listeners.bal @@ -17,9 +17,6 @@ import ballerina/graphql; import ballerina/http; -listener http:Listener http2Listener = new http:Listener(9090); -listener graphql:Listener http2BasedListener = new (http2Listener); - listener graphql:Listener subscriptionListener = new (9091); listener http:Listener httpListener = new (9092, httpVersion = http:HTTP_1_1); diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/object_types.bal similarity index 50% rename from ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal rename to ballerina-tests/graphql-subscription-test-suite/modules/three/tests/object_types.bal index e422adf8d..3821f98ab 100644 --- a/ballerina-tests/graphql-subscription-test-suite/tests/object_types.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/object_types.bal @@ -14,10 +14,6 @@ // specific language governing permissions and limitations // under the License. -import ballerina/lang.runtime; - -public type PeopleService StudentService|TeacherService; - public distinct isolated service class StudentService { private final int id; private final string name; @@ -36,54 +32,6 @@ public distinct isolated service class StudentService { } } -public distinct isolated service class TeacherService { - private final int id; - private string name; - private string subject; - - public isolated function init(int id, string name, string subject) { - self.id = id; - self.name = name; - self.subject = subject; - } - - isolated resource function get id() returns int { - return self.id; - } - - isolated resource function get name() returns string { - lock { - return self.name; - } - } - - isolated function setName(string name) { - lock { - self.name = name; - } - } - - isolated resource function get subject() returns string { - lock { - return self.subject; - } - } - - isolated function setSubject(string subject) { - lock { - self.subject = subject; - } - } - - isolated resource function get holidays() returns Weekday[] { - return [SATURDAY, SUNDAY]; - } - - isolated resource function get school() returns School { - return new School("CHEM"); - } -} - class EvenNumberGenerator { private int i = 0; @@ -99,37 +47,6 @@ class EvenNumberGenerator { } } -class RefreshData { - public isolated function next() returns record {|string value;|}? { - // emit data every one second - runtime:sleep(1); - return {value: "data"}; - } -} - -public distinct isolated service class School { - private string name; - - public isolated function init(string name) { - self.name = name; - } - - isolated resource function get name() returns string { - lock { - return self.name; - } - } - - # Get the opening days of the school. - # + return - The set of the weekdays the school is open - # # Deprecated - # School is now online. - @deprecated - isolated resource function get openingDays() returns Weekday[] { - return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; - } -} - public service class AccountDetails { final string name; final int createdYear; diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/records.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/records.bal new file mode 100644 index 000000000..206243b7c --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/records.bal @@ -0,0 +1,40 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public type Review record {| + Product product; + int score; + string description; +|}; + +public type AccountRecords record {| + map details; +|}; + +public type Book readonly & record { + string name; + string author; +}; + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/services.bal new file mode 100644 index 000000000..9511e57ce --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/services.bal @@ -0,0 +1,59 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +service /subscriptions on subscriptionListener { + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } + + isolated resource function subscribe students() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } + + isolated resource function subscribe values() returns stream|error { + int[] array = []; + int _ = check trap array.remove(0); + return array.toStream(); + } + + isolated resource function subscribe evenNumber() returns stream { + EvenNumberGenerator evenNumberGenerator = new; + return new (evenNumberGenerator); + } +} + +service /reviews on wrappedListener { + resource function get greet() returns string { + return "Welcome!"; + } + + resource function subscribe live() returns stream { + return reviews.toArray().toStream(); + } + + resource function subscribe accountUpdates() returns stream { + map details = {acc1: new AccountDetails("James", 2022), acc2: new AccountDetails("Paul", 2015)}; + map updatedDetails = {...details}; + updatedDetails["acc1"] = new AccountDetails("James Deen", 2022); + return [{details}, {details: updatedDetails}].toStream(); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/values.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/values.bal similarity index 90% rename from ballerina-tests/graphql-subscription-test-suite/tests/values.bal rename to ballerina-tests/graphql-subscription-test-suite/modules/three/tests/values.bal index fbcb22680..e90aec49c 100644 --- a/ballerina-tests/graphql-subscription-test-suite/tests/values.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/values.bal @@ -14,8 +14,6 @@ // specific language governing permissions and limitations // under the License. -const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; - table reviews = table [ {product: new ("1"), score: 20, description: "Product 01"}, {product: new ("2"), score: 20, description: "Product 02"}, @@ -23,5 +21,3 @@ table reviews = table [ {product: new ("4"), score: 20, description: "Product 04"}, {product: new ("5"), score: 20, description: "Product 05"} ]; - -public string[] namesArray = ["Walter", "Skyler"]; diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal new file mode 100644 index 000000000..cced36cc2 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal @@ -0,0 +1,152 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["introspection", "typename", "subscriptions"] +} +isolated function testSubscriptionWithIntrospectionInFields() returns error? { + string document = string `subscription { students { __typename } }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {students: {__typename: "StudentService"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testInvalidSubscription() returns error? { + string document = string `subscription { invalidField }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = check common:getJsonContentFromFile("subscription_invalid_field"); + check common:validateErrorMessage(wsClient, expectedMsgPayload); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionFunctionWithErrors() returns error? { + string document = string `subscription getNames { values }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedErrorPayload = [ + { + message: "{ballerina/lang.array}IndexOutOfRange", + locations: [{line: 1, column: 25}], + path: ["values"] + } + ]; + check common:validateErrorMessage(wsClient, expectedErrorPayload); +} + +@test:Config { + groups: ["service", "subscriptions"] +} +isolated function testSubscriptionWithServiceObjects() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendSubscriptionMessage(wsClient, document); + + json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; + check common:validateNextMessage(wsClient, expectedMsgPayload); + check common:validateCompleteMessage(wsClient); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testSubscriptionWithMultipleClients() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + foreach int i in 1 ..< 6 { + json expectedMsgPayload = {data: {messages: i}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } + check common:validateCompleteMessage(wsClient1, id = "1"); + check common:validateCompleteMessage(wsClient2, id = "2"); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testConnectionInitMessage() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:sendConnectionInitMessage(wsClient); + check common:validateConnectionAckMessage(wsClient); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testInvalidMultipleConnectionInitMessages() returns error? { + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + check common:sendConnectionInitMessage(wsClient); + + string expectedErrorMsg = "Too many initialisation requests: Status code: 4429"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} + +@test:Config { + groups: ["subscriptions"] +} +isolated function testUnauthorizedAccess() returns error? { + string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); + string url = "ws://localhost:9091/subscriptions"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:sendSubscriptionMessage(wsClient, document); + + string expectedErrorMsg = "Unauthorized: Status code: 4401"; + common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/listeners.bal new file mode 100644 index 000000000..046624e3c --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/listeners.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener subscriptionListener = new (9091); diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/object_types.bal new file mode 100644 index 000000000..50ae545fa --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/object_types.bal @@ -0,0 +1,33 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public distinct isolated service class StudentService { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/services.bal new file mode 100644 index 000000000..2a96c75c3 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/services.bal @@ -0,0 +1,37 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +service /subscriptions on subscriptionListener { + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } + + isolated resource function subscribe students() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } + + isolated resource function subscribe values() returns stream|error { + int[] array = []; + int _ = check trap array.remove(0); + return array.toStream(); + } +} \ No newline at end of file diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal b/ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal deleted file mode 100644 index c2c1974eb..000000000 --- a/ballerina-tests/graphql-subscription-test-suite/tests/01_subscription_tests.bal +++ /dev/null @@ -1,616 +0,0 @@ -// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/graphql; -import ballerina/graphql_test_common as common; -import ballerina/test; -import ballerina/websocket; - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscription() returns error? { - string document = string `subscription { name }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {name: "Walter"}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {name: "Skyler"}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionWithoutSubProtocol() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:Client|error wsClient = new (url); - string expectedErrorMsg = "InvalidHandshakeError: Invalid handshake response getStatus: 400 Bad Request"; - test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); - test:assertEquals((wsClient).message(), expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionsWithMultipleOperations() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_multiple_operations"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "getMessages"); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "getStringMessages"); - - json expectedMsgPayload = {data: null}; - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - foreach int i in 1 ..< 4 { - expectedMsgPayload = {data: {messages: i}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - expectedMsgPayload = {data: {stringMessages: i.toString()}}; - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } - string httpUrl = "http://localhost:9091/subscriptions"; - json actualPayload = check common:getJsonPayloadFromService(httpUrl, document, operationName = "getName"); - json expectedPayload = {data: {name: "Walter White"}}; - common:assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["records", "subscriptions"] -} -isolated function testSubscriptionWithRecords() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_records"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testQueryWithSameSubscriptionFieldName() returns error? { - string document = string `query { name }`; - string url = "http://localhost:9091/subscriptions"; - json actualPayload = check common:getJsonPayloadFromService(url, document); - json expectedPayload = {data: {name: "Walter White"}}; - common:assertJsonValuesWithOrder(actualPayload, expectedPayload); -} - -@test:Config { - groups: ["fragments", "subscriptions"] -} -isolated function testSubscriptionWithFragments() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_fragments"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["union", "subscriptions"] -} -isolated function testSubscriptionWithUnionType() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_union_type"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {multipleValues: {id: 1, name: "Jesse Pinkman"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {multipleValues: {name: "Walter White", subject: "Chemistry"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["variables", "subscriptions"] -} -isolated function testSubscriptionWithVariables() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_variable_values"); - json variables = {"value": 4}; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document, variables = variables); - - foreach int i in 1 ..< 3 { - json expectedMsgPayload = {data: {filterValues: i}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - } -} - -@test:Config { - groups: ["introspection", "typename", "subscriptions"] -} -isolated function testSubscriptionWithIntrospectionInFields() returns error? { - string document = string `subscription { students { __typename } }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {students: {__typename: "StudentService"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testInvalidSubscription() returns error? { - string document = string `subscription { invalidField }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = check common:getJsonContentFromFile("subscription_invalid_field"); - check common:validateErrorMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionFunctionWithErrors() returns error? { - string document = string `subscription getNames { values }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedErrorPayload = [ - { - message: "{ballerina/lang.array}IndexOutOfRange", - locations: [{line: 1, column: 25}], - path: ["values"] - } - ]; - check common:validateErrorMessage(wsClient, expectedErrorPayload); -} - -@test:Config { - groups: ["service", "subscriptions"] -} -isolated function testSubscriptionWithServiceObjects() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {students: {id: 1, name: "Eren Yeager"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {students: {id: 2, name: "Mikasa Ackerman"}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - check common:validateCompleteMessage(wsClient); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionWithMultipleClients() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, "2"); - - foreach int i in 1 ..< 6 { - json expectedMsgPayload = {data: {messages: i}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } - check common:validateCompleteMessage(wsClient1, id = "1"); - check common:validateCompleteMessage(wsClient2, id = "2"); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testConnectionInitMessage() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:sendConnectionInitMessage(wsClient); - check common:validateConnectionAckMessage(wsClient); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testInvalidMultipleConnectionInitMessages() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendConnectionInitMessage(wsClient); - - string expectedErrorMsg = "Too many initialisation requests: Status code: 4429"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testUnauthorizedAccess() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:sendSubscriptionMessage(wsClient, document); - - string expectedErrorMsg = "Unauthorized: Status code: 4401"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -function testAlreadyExistingSubscriber() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_service_objects"); - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - string clientId = wsClient.getConnectionId(); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document, clientId); - check common:sendSubscriptionMessage(wsClient, document, clientId); - string expectedErrorMsg = "Subscriber for " + clientId + " already exists: Status code: 4409"; - int i = 0; - json|error response; - while true { - i += 1; - response = common:readMessageExcludingPingMessages(wsClient); - if response is error { - break; - } - if i > 3 { - test:assertFail(string `Expected: ${expectedErrorMsg}, Found: ${response.toString()}`); - } - json|error id = response.id; - if id is error { - test:assertFail(string `Expected json with id found: ${response.toString()}`); - } - } - test:assertEquals((response).message(), expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testOnPing() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check wsClient->writeMessage({'type: common:WS_PING}); - json response = check wsClient->readMessage(); - test:assertEquals(response.'type, common:WS_PONG); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testInvalidSubProtocolInSubscriptions() returns error? { - string url = "ws://localhost:9091/subscriptions"; - string subProtocol = "graphql-invalid-ws"; - websocket:ClientConfiguration config = {subProtocols: [subProtocol]}; - websocket:Client|error wsClient = new (url, config); - test:assertTrue(wsClient is websocket:InvalidHandshakeError, "Invalid handshake error expected"); - string expectedErrorMsg = "InvalidHandshakeError: Invalid subprotocol. Actual: null." + - " Expected one of: graphql-invalid-ws"; - test:assertEquals((wsClient).message(), expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions", "runtime_errors"] -} -isolated function testErrorsInStreams() returns error? { - string document = "subscription { evenNumber }"; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {evenNumber: 2}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = check common:getJsonContentFromFile("errors_in_streams"); - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {evenNumber: 6}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testMultipleSubscriptionUsingSingleClient() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - - check common:sendSubscriptionMessage(wsClient, document, "1"); - foreach int i in 1 ..< 6 { - json expectedMsgPayload = {data: {messages: i}}; - check common:validateNextMessage(wsClient, expectedMsgPayload, id = "1"); - } - check common:validateCompleteMessage(wsClient, id = "1"); - - check common:sendSubscriptionMessage(wsClient, document, "2"); - foreach int i in 1 ..< 6 { - json expectedMsgPayload = {data: {messages: i}}; - check common:validateNextMessage(wsClient, expectedMsgPayload, id = "2"); - } - check common:validateCompleteMessage(wsClient, id = "2"); -} - -@test:Config { - groups: ["subscriptions"] -} -isolated function testSubscriptionWithInvalidPayload() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - json invalidPayload = {'type: "start"}; - check wsClient->writeMessage(invalidPayload); - - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["subscriptions", "recrods", "service"] -} -isolated function testResolverReturingStreamOfRecordsWithServiceObjects() returns error? { - string document = "subscription { live { product { id } score } }"; - string url = "ws://localhost:9092/reviews"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedPayload = {data: {live: {product: {id: "1"}, score: 20}}}; - check common:validateNextMessage(wsClient, expectedPayload); -} - -@test:Config { - groups: ["subscriptions", "recrods", "service", "maps"] -} -isolated function testResolverReturingStreamOfRecordsWithMapOfServiceObjects() returns error? { - string document = string `subscription { accountUpdates { details(key: "acc1") { name } } }`; - string url = "ws://localhost:9092/reviews"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - - json expectedMsgPayload = {data: {accountUpdates: {details: {name: "James"}}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); - expectedMsgPayload = {data: {accountUpdates: {details: {name: "James Deen"}}}}; - check common:validateNextMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["subscriptions", "multiplexing"] -} -isolated function testSubscriptionMultiplexing() returns error? { - string document = string `subscription { refresh }`; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document, "1"); - check common:sendSubscriptionMessage(wsClient, document, "2"); - - boolean subscriptionOneDisabled = false; - map subscriptions = {"1": 0, "2": 0}; - while true { - json actualPayload = check common:readMessageExcludingPingMessages(wsClient); - string subscriptionId = check actualPayload.id; - subscriptions[subscriptionId] = subscriptions.get(subscriptionId) + 1; - if subscriptionOneDisabled && subscriptionId == "1" { - test:assertFail("Subscription one already unsubscirbed. No further data should be sent by ther server."); - } - if subscriptionId == "1" && subscriptions.get(subscriptionId) == 3 { - subscriptionOneDisabled = true; - check wsClient->writeMessage({'type: common:WS_COMPLETE, id: subscriptionId}); - } - if subscriptionId == "2" && subscriptions.get(subscriptionId) == 10 { - check wsClient->writeMessage({'type: common:WS_COMPLETE, id: subscriptionId}); - break; - } - json payload = {data: {refresh: "data"}}; - json expectedPayload = {'type: common:WS_NEXT, id: subscriptionId, payload: payload}; - test:assertEquals(actualPayload, expectedPayload); - } -} - -@test:Config { - groups: ["subscriptions", "recrods", "service"] -} -isolated function testConnectionClousureWhenPongNotRecived() returns error? { - string url = "ws://localhost:9092/reviews"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - json|error response; - while true { - response = wsClient->readMessage(); - if response is json { - test:assertTrue(response.'type == common:WS_PING); - continue; - } - break; - } - test:assertTrue(response is error, "Expected connection clousure error"); - test:assertEquals((response).message(), "Request timeout: Status code: 4408"); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketRequestWithEmptyQuery() returns error? { - string document = ""; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document); - json expectedMsgPayload = {errors: [{message: "An empty query is found"}]}; - check common:validateErrorMessage(wsClient, expectedMsgPayload); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - json payload = {query: 2}; - check wsClient->writeMessage({"type": common:WS_SUBSCRIBE, id: "1", payload: payload}); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketRequestWithoutQuery() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check wsClient->writeMessage({"type": common:WS_SUBSCRIBE, id: "1", payload: {}}); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidVariableInWebSocketPayload() returns error? { - string document = check common:getGraphqlDocumentFromFile("subscriptions_with_variable_values"); - json variables = []; - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - check common:sendSubscriptionMessage(wsClient, document, variables = variables); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testEmptyWebSocketPayload() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - string payload = ""; - check wsClient->writeMessage(payload); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" + - " 'graphql-transport-ws' subprotocol: Status code: 1003"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["request_validation", "websocket", "subscriptions"] -} -isolated function testInvalidWebSocketPayload() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:Client wsClient = check new (url, {subProtocols: [GRAPHQL_TRANSPORT_WS]}); - json payload = {payload: {query: ()}}; - check wsClient->writeMessage(payload); - string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" - + " 'graphql-transport-ws' subprotocol: Status code: 1003"; - common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); -} - -@test:Config { - groups: ["listener", "subscriptions"] -} -function testAttachServiceWithSubscriptionToHttp2BasedListener() returns error? { - graphql:Error? result = http2BasedListener.attach(subscriptionService); - test:assertTrue(result is graphql:Error); - graphql:Error err = result; - string expecctedMessage = string `Websocket listener initialization failed due to the incompatibility of ` + - string `provided HTTP(version 2.0) listener`; - test:assertEquals(err.message(), expecctedMessage); -} - -@test:Config { - groups: ["listener", "subscriptions"] -} -function testAttachServiceWithSubscriptionToHttp1BasedListener() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9092/service_with_http1"; - websocket:ClientConfiguration config = {subProtocols: [GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, "2"); - - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: i}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } -} diff --git a/ballerina-tests/graphql-subscription-test-suite/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/tests/services.bal deleted file mode 100644 index 9bf03999c..000000000 --- a/ballerina-tests/graphql-subscription-test-suite/tests/services.bal +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/graphql; -import ballerina/http; - -service /subscriptions on subscriptionListener { - isolated resource function get name() returns string { - return "Walter White"; - } - - resource function subscribe name() returns stream { - return namesArray.toStream(); - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } - - isolated resource function subscribe stringMessages() returns stream { - string?[] stringArray = [(), "1", "2", "3", "4", "5"]; - return stringArray.toStream(); - } - - isolated resource function subscribe books() returns stream { - Book[] books = [ - {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, - {name: "A Game of Thrones", author: "George R.R. Martin"} - ]; - return books.toStream(); - } - - isolated resource function subscribe students() returns stream { - StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; - return students.toStream(); - } - - isolated resource function subscribe filterValues(int value) returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - int[] filteredArray = []; - foreach int i in intArray { - if i < value { - filteredArray.push(i); - } - } - return filteredArray.toStream(); - } - - isolated resource function subscribe values() returns stream|error { - int[] array = []; - int _ = check trap array.remove(0); - return array.toStream(); - } - - isolated resource function subscribe multipleValues() returns stream<(PeopleService)>|error { - StudentService s = new StudentService(1, "Jesse Pinkman"); - TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); - return [s, t].toStream(); - } - - isolated resource function subscribe evenNumber() returns stream { - EvenNumberGenerator evenNumberGenerator = new; - return new (evenNumberGenerator); - } - - isolated resource function subscribe refresh() returns stream { - RefreshData dataRefersher = new; - return new (dataRefersher); - } -} - -service /reviews on wrappedListener { - resource function get greet() returns string { - return "Welcome!"; - } - - resource function subscribe live() returns stream { - return reviews.toArray().toStream(); - } - - resource function subscribe accountUpdates() returns stream { - map details = {acc1: new AccountDetails("James", 2022), acc2: new AccountDetails("Paul", 2015)}; - map updatedDetails = {...details}; - updatedDetails["acc1"] = new AccountDetails("James Deen", 2022); - return [{details}, {details: updatedDetails}].toStream(); - } -} - -graphql:Service subscriptionService = service object { - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -}; - -isolated service /service_with_http1 on wrappedListener { - isolated resource function get greet() returns string { - return "welcome!"; - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - contextInit: - isolated function(http:RequestContext requestContext, http:Request request) returns graphql:Context|error { - graphql:Context context = new; - context.set("scope", check request.getHeader("scope")); - return context; - } -} -service /context on wrappedListener { - isolated resource function get greet() returns string { - return "welcome!"; - } - - isolated resource function subscribe messages(graphql:Context context) returns stream|error { - var scope = context.get("scope"); - if scope is string && scope == "admin" { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } - return error("You don't have permission to retrieve data"); - } -} - -service /constraints on subscriptionListener { - isolated resource function get greet() returns string { - return "welcome!"; - } - - isolated resource function subscribe movie(MovieDetails movie) returns stream { - return movie.reviews.toStream(); - } -} diff --git a/ballerina-tests/graphql-test-common/constants.bal b/ballerina-tests/graphql-test-common/constants.bal index a2d6ec0bc..b4ec8dbed 100644 --- a/ballerina-tests/graphql-test-common/constants.bal +++ b/ballerina-tests/graphql-test-common/constants.bal @@ -27,3 +27,5 @@ public const WS_SUBSCRIBE = "subscribe"; public const WS_NEXT = "next"; public const WS_ERROR = "error"; public const WS_COMPLETE = "complete"; + +public const GRAPHQL_TRANSPORT_WS = "graphql-transport-ws"; From 25af5fa3bdfc2c41f094a85df6b8527d59c017be Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Thu, 3 Oct 2024 14:53:15 +0530 Subject: [PATCH 11/15] Set BALLERINA_MAX_POOL_SIZE --- ballerina-tests/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina-tests/build.gradle b/ballerina-tests/build.gradle index e0ca15162..9a6154432 100644 --- a/ballerina-tests/build.gradle +++ b/ballerina-tests/build.gradle @@ -172,7 +172,7 @@ task ballerinaTest { if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine 'cmd', '/c', "${balJavaDebugParam} ${distributionBinPath}/bal.bat test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams} && exit %%ERRORLEVEL%%" } else { - commandLine 'sh', '-c', "${balJavaDebugParam} ${distributionBinPath}/bal test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams}" + commandLine 'sh', '-c', "BALLERINA_MAX_POOL_SIZE=500 ${balJavaDebugParam} ${distributionBinPath}/bal test ${graalvmFlag} ${testParams} --offline ${groupParams} ${disableGroups} ${debugParams}" } } } From 520791ae7ee73ff5096c3d01bcdf60011a420f38 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Fri, 4 Oct 2024 19:03:55 +0530 Subject: [PATCH 12/15] [Automated] Update the native jar versions --- .../graphql-interceptor-test-suite/Dependencies.toml | 6 +----- .../graphql-subscription-test-suite/Dependencies.toml | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml b/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml index e4a85adac..59b605b5a 100644 --- a/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-interceptor-test-suite/Dependencies.toml @@ -105,8 +105,7 @@ dependencies = [ {org = "ballerina", name = "graphql_test_common"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "test"}, - {org = "ballerina", name = "websocket"} + {org = "ballerina", name = "test"} ] modules = [ {org = "ballerina", packageName = "graphql_interceptor_test_suite", moduleName = "graphql_interceptor_test_suite"} @@ -420,7 +419,4 @@ dependencies = [ {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "time"} ] -modules = [ - {org = "ballerina", packageName = "websocket", moduleName = "websocket"} -] diff --git a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml index 9755e6198..af58def84 100644 --- a/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-subscription-test-suite/Dependencies.toml @@ -117,6 +117,7 @@ modules = [ {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.five"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.four"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.one"}, + {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.six"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.three"}, {org = "ballerina", packageName = "graphql_subscription_test_suite", moduleName = "graphql_subscription_test_suite.two"} ] From 9710606e2c7b305d815537bb90c46baf39404f5f Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Fri, 4 Oct 2024 19:12:23 +0530 Subject: [PATCH 13/15] Move interceptor test related to subscription operation to sub-module six under subscription test suite --- .../tests/01_interceptor_tests.bal | 278 ---------------- .../tests/interceptors.bal | 135 +------- .../tests/services.bal | 129 -------- .../four/tests/01_subscription_four_tests.bal | 22 -- .../six/tests/01_subscription_six_tests.bal | 40 +++ .../01_subscription_with_interceptors.bal | 296 ++++++++++++++++++ .../modules/six/tests/interceptors.bal | 150 +++++++++ .../modules/six/tests/listeners.bal | 20 ++ .../modules/six/tests/object_types.bal | 106 +++++++ .../modules/six/tests/records.bal | 31 ++ .../modules/six/tests/services.bal | 146 +++++++++ .../two/tests/01_subscription_two_tests.bal | 3 +- ...rs_with_fragments_and_subscription.graphql | 0 ...s_with_subscription_return_records.graphql | 0 ...ith_subscription_return_union_type.graphql | 0 15 files changed, 793 insertions(+), 563 deletions(-) create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/interceptors.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/listeners.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/object_types.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/records.bal create mode 100644 ballerina-tests/graphql-subscription-test-suite/modules/six/tests/services.bal rename ballerina-tests/{graphql-interceptor-test-suite => graphql-subscription-test-suite}/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql (100%) rename ballerina-tests/{graphql-interceptor-test-suite => graphql-subscription-test-suite}/tests/resources/documents/interceptors_with_subscription_return_records.graphql (100%) rename ballerina-tests/{graphql-interceptor-test-suite => graphql-subscription-test-suite}/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql (100%) diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal index 667244c85..a667d7035 100644 --- a/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/01_interceptor_tests.bal @@ -16,7 +16,6 @@ import ballerina/graphql_test_common as common; import ballerina/test; -import ballerina/websocket; @test:Config { groups: ["interceptors"], @@ -90,280 +89,3 @@ function dataProviderInterceptors() returns string[][] { [url17, "resource_interceptors"] ]; } - -@test:Config { - groups: ["interceptors", "subscriptions"] -} -isolated function testInterceptorsWithSubscriptionReturningScalar() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9091/subscription_interceptor1"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, "2"); - - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } -} - -@test:Config { - groups: ["interceptors", "subscriptions", "records"] -} -isolated function testInterceptorsWithSubscriptionReturningRecord() returns error? { - string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_records"); - string url = "ws://localhost:9091/subscription_interceptor2"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, operationName = "A"); - json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Athur Conan Doyle"}}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload); - expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "Athur Conan Doyle"}}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, operationName = "B"); - expectedMsgPayload = {data: {newBooks: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; - check common:validateNextMessage(wsClient2, expectedMsgPayload); -} - -@test:Config { - groups: ["interceptors", "fragments", "subscriptions"] -} -isolated function testInterceptorsWithSubscriptionAndFragments() returns error? { - string document = check common:getGraphqlDocumentFromFile("interceptors_with_fragments_and_subscription"); - string url = "ws://localhost:9091/subscription_interceptor3"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, operationName = "getStudents"); - json expectedMsgPayload = {data: {students: {id: 1, name: "Harry Potter"}}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload); - expectedMsgPayload = {data: {students: {id: 2, name: "Harry Potter"}}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, operationName = "getNewStudents"); - expectedMsgPayload = {data: {newStudents: {id: 4, name: "Ron Weasley"}}}; - check common:validateNextMessage(wsClient2, expectedMsgPayload); -} - -@test:Config { - groups: ["interceptors", "union", "subscriptions"] -} -isolated function testInterceptorsWithUnionTypeSubscription() returns error? { - string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); - string url = "ws://localhost:9091/subscription_interceptor4"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, operationName = "unionTypes1"); - json expectedMsgPayload = { - data: { - multipleValues1: { - id: 100, - name: "Jesse Pinkman" - } - } - }; - check common:validateNextMessage(wsClient1, expectedMsgPayload); - expectedMsgPayload = { - data: { - multipleValues1: { - name: "Walter White", - subject: "Physics" - } - } - }; - check common:validateNextMessage(wsClient1, expectedMsgPayload); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, operationName = "unionTypes2"); - expectedMsgPayload = { - data: { - multipleValues2: { - name: "Walter White", - subject: "Chemistry" - } - } - }; - check common:validateNextMessage(wsClient2, expectedMsgPayload); -} - -@test:Config { - groups: ["interceptors", "subscriptions"] -} -isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9091/subscription_interceptor5"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, "2"); - - json expectedMsgPayload = {data: {messages: 1}}; - foreach int i in 1 ..< 4 { - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } -} - -@test:Config { - groups: ["interceptors", "subscriptions"] -} -isolated function testInterceptorsDestructiveModificationWithSubscription() returns error? { - string document = string `subscription { messages }`; - string url = "ws://localhost:9091/subscription_interceptor6"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - check common:sendSubscriptionMessage(wsClient1, document, "1"); - - websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - check common:sendSubscriptionMessage(wsClient2, document, "2"); - - json expectedMsgPayload = { - errors: [ - { - message: "Invalid return type in Interceptor \"DestructiveModification\". Expected type Int!", - locations: [ - { - line: 1, - column: 16 - } - ], - path: [ - "messages" - ] - }, - { - message: "Invalid return type in Interceptor \"DestructiveModification\". Expected type Int!", - locations: [ - { - line: 1, - column: 16 - } - ], - path: ["messages"] - } - ], - data: null - }; - foreach int i in 1 ..< 4 { - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } -} - -@test:Config { - groups: ["interceptors", "subscriptions"] -} -isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns error? { - final string document = string `subscription { messages }`; - string url = "ws://localhost:9091/subscription_interceptor1"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - final websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - - final websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - - final websocket:Client wsClient3 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient3); - - worker A returns error? { - check common:sendSubscriptionMessage(wsClient1, document, "1"); - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - } - } - worker B returns error? { - check common:sendSubscriptionMessage(wsClient2, document, "2"); - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } - } - check common:sendSubscriptionMessage(wsClient3, document, "3"); - foreach int i in 1 ..< 4 { - json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; - check common:validateNextMessage(wsClient3, expectedMsgPayload, id = "3"); - } - check wait A; - check wait B; -} - -@test:Config { - groups: ["interceptors", "union", "subscriptions"] -} -isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns error? { - final string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); - string url = "ws://localhost:9091/subscription_interceptor4"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - final websocket:Client wsClient1 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient1); - - final websocket:Client wsClient2 = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient2); - - worker A returns error? { - check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "unionTypes1"); - json expectedMsgPayload = { - data: { - multipleValues1: { - id: 100, - name: "Jesse Pinkman" - } - } - }; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - expectedMsgPayload = { - data: { - multipleValues1: { - name: "Walter White", - subject: "Physics" - } - } - }; - check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); - } - worker B returns error? { - check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "unionTypes1"); - json expectedMsgPayload = { - data: { - multipleValues1: { - id: 100, - name: "Jesse Pinkman" - } - } - }; - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - expectedMsgPayload = { - data: { - multipleValues1: { - name: "Walter White", - subject: "Physics" - } - } - }; - check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); - } - check wait A; - check wait B; -} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal index 8cf3637aa..59f72fe91 100644 --- a/ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/interceptors.bal @@ -703,114 +703,12 @@ readonly service class TableInterceptor2 { } } -readonly service class Multiplication { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - var result = context.resolve('field); - if result is int { - return result * 5; - } - return result; - } -} - -readonly service class Subtraction { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - var result = context.resolve('field); - if result is int { - return result - 5; - } - return result; - } -} - -readonly service class InterceptAuthor { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - var result = context.resolve('field); - if 'field.getName() == "author" { - return "Athur Conan Doyle"; - } - return result; - } -} - -readonly service class InterceptBook { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - _ = context.resolve('field); - Book b = {name: "A Game of Thrones", author: "George R.R. Martin"}; - return b; - } -} - -readonly service class InterceptStudentName { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - var result = context.resolve('field); - if 'field.getName() == "name" { - return "Harry Potter"; - } - return result; - } -} - -readonly service class InterceptStudent { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - _ = context.resolve('field); - return {id: 4, name: "Ron Weasley"}; - } -} - -readonly service class InterceptUnionType1 { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - var result = context.resolve('field); - if 'field.getName() == "subject" { - return "Physics"; - } - if 'field.getName() == "id" { - return 100; - } - return result; - } -} - -readonly service class InterceptUnionType2 { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - _ = context.resolve('field); - return {id: 0, name: "Walter White", subject: "Chemistry"}; - } -} - -readonly service class ReturnBeforeResolver { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - return 1; - } -} - -@graphql:InterceptorConfig { - global: false -} -readonly service class DestructiveModification { +readonly service class City { *graphql:Interceptor; isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { _ = context.resolve('field); - return "Ballerina"; + return "New York"; } } @@ -823,15 +721,6 @@ readonly service class Street { } } -readonly service class City { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { - _ = context.resolve('field); - return "New York"; - } -} - @graphql:InterceptorConfig { global: false } @@ -867,23 +756,3 @@ readonly service class LogSubfields { return context.resolve('field); } } - -readonly service class AuthorInterceptor { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata { - var data = context.resolve('field); - // Return only the first author - return ('field.getName() == "authors" && data is anydata[]) ? [data[0]] : data; - } -} - -readonly service class BookInterceptor { - *graphql:Interceptor; - - isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata { - var books = context.resolve('field); - // Return only the first book - return (books is anydata[]) ? [books[0]] : books; - } -} diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal b/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal index 2f4bbe263..87ad9795d 100644 --- a/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal +++ b/ballerina-tests/graphql-interceptor-test-suite/tests/services.bal @@ -469,135 +469,6 @@ service /invalid_interceptor4 on basicListener { } } -@graphql:ServiceConfig { - interceptors: [new DestructiveModification()] -} -isolated service /subscription_interceptor6 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - @graphql:ResourceConfig { - interceptors: new DestructiveModification() - } - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: new ReturnBeforeResolver() -} -isolated service /subscription_interceptor5 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: [new Subtraction(), new Multiplication()] -} -isolated service /subscription_interceptor1 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - @graphql:ResourceConfig { - interceptors: [new Subtraction(), new Multiplication()] - } - isolated resource function subscribe messages() returns stream { - int[] intArray = [1, 2, 3, 4, 5]; - return intArray.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: [new InterceptAuthor(), new ServiceLevelInterceptor()] -} -isolated service /subscription_interceptor2 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe books() returns stream { - Book?[] books = [ - {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, - {name: "A Game of Thrones", author: "George R.R. Martin"}, - () - ]; - return books.toStream(); - } - - @graphql:ResourceConfig { - interceptors: [new InterceptBook()] - } - isolated resource function subscribe newBooks() returns stream { - Book?[] books = [ - {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, - () - ]; - return books.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: new InterceptStudentName() -} -isolated service /subscription_interceptor3 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe students() returns stream { - StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; - return students.toStream(); - } - - @graphql:ResourceConfig { - interceptors: [new InterceptStudent()] - } - isolated resource function subscribe newStudents() returns stream { - StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; - return students.toStream(); - } -} - -@graphql:ServiceConfig { - interceptors: new InterceptUnionType1() -} -isolated service /subscription_interceptor4 on subscriptionListener { - - isolated resource function get name() returns string { - return "Walter White"; - } - - isolated resource function subscribe multipleValues1() returns stream|error { - StudentService s = new StudentService(1, "Jesse Pinkman"); - TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); - return [s, t].toStream(); - } - - @graphql:ResourceConfig { - interceptors: new InterceptUnionType2() - } - isolated resource function subscribe multipleValues2() returns stream|error { - StudentService s = new StudentService(1, "Harry Potter"); - TeacherService t = new TeacherService(3, "Severus Snape", "Dark Arts"); - return [s, t].toStream(); - } -} - service /field_caching_with_interceptors on basicListener { private string enemy = "voldemort"; private string friend = "Harry"; diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal index 0ee7a148f..64590962d 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal @@ -139,25 +139,3 @@ isolated function testInvalidWebSocketPayload() returns error? { + " 'graphql-transport-ws' subprotocol: Status code: 1003"; common:validateConnectionClousureWithError(wsClient, expectedErrorMsg); } - -@test:Config { - groups: ["subscriptions", "recrods", "service"] -} -isolated function testConnectionClousureWhenPongNotRecived() returns error? { - string url = "ws://localhost:9091/subscriptions"; - websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; - websocket:Client wsClient = check new (url, config); - check common:initiateGraphqlWsConnection(wsClient); - json|error response; - while true { - response = wsClient->readMessage(); - if response is json { - test:assertTrue(response.'type == common:WS_PING); - continue; - } - break; - } - test:assertTrue(response is error, "Expected connection clousure error"); - test:assertEquals((response).message(), "Request timeout: Status code: 4408"); -} - diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal new file mode 100644 index 000000000..a75f2be7f --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal @@ -0,0 +1,40 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["subscriptions", "service"] +} +isolated function testConnectionClousureWhenPongNotRecived() returns error? { + string url = "ws://localhost:9091/subscription_interceptor1"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient); + json|error response; + while true { + response = wsClient->readMessage(); + if response is json { + test:assertTrue(response.'type == common:WS_PING); + continue; + } + break; + } + test:assertTrue(response is error, "Expected connection clousure error"); + test:assertEquals((response).message(), "Request timeout: Status code: 4408"); +} \ No newline at end of file diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal new file mode 100644 index 000000000..f61e6575e --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal @@ -0,0 +1,296 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql_test_common as common; +import ballerina/test; +import ballerina/websocket; + +@test:Config { + groups: ["interceptors", "subscriptions"] +} +isolated function testInterceptorsWithSubscriptionReturningScalar() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscription_interceptor1"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } +} + +@test:Config { + groups: ["interceptors", "subscriptions", "records"] +} +isolated function testInterceptorsWithSubscriptionReturningRecord() returns error? { + string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_records"); + string url = "ws://localhost:9091/subscription_interceptor2"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, operationName = "A"); + json expectedMsgPayload = {data: {books: {name: "Crime and Punishment", author: "Athur Conan Doyle"}}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload); + expectedMsgPayload = {data: {books: {name: "A Game of Thrones", author: "Athur Conan Doyle"}}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, operationName = "B"); + expectedMsgPayload = {data: {newBooks: {name: "A Game of Thrones", author: "George R.R. Martin"}}}; + check common:validateNextMessage(wsClient2, expectedMsgPayload); +} + +@test:Config { + groups: ["interceptors", "fragments", "subscriptions"] +} +isolated function testInterceptorsWithSubscriptionAndFragments() returns error? { + string document = check common:getGraphqlDocumentFromFile("interceptors_with_fragments_and_subscription"); + string url = "ws://localhost:9091/subscription_interceptor3"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, operationName = "getStudents"); + json expectedMsgPayload = {data: {students: {id: 1, name: "Harry Potter"}}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload); + expectedMsgPayload = {data: {students: {id: 2, name: "Harry Potter"}}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, operationName = "getNewStudents"); + expectedMsgPayload = {data: {newStudents: {id: 4, name: "Ron Weasley"}}}; + check common:validateNextMessage(wsClient2, expectedMsgPayload); +} + +@test:Config { + groups: ["interceptors", "union", "subscriptions"] +} +isolated function testInterceptorsWithUnionTypeSubscription() returns error? { + string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); + string url = "ws://localhost:9091/subscription_interceptor4"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, operationName = "unionTypes1"); + json expectedMsgPayload = { + data: { + multipleValues1: { + id: 100, + name: "Jesse Pinkman" + } + } + }; + check common:validateNextMessage(wsClient1, expectedMsgPayload); + expectedMsgPayload = { + data: { + multipleValues1: { + name: "Walter White", + subject: "Physics" + } + } + }; + check common:validateNextMessage(wsClient1, expectedMsgPayload); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, operationName = "unionTypes2"); + expectedMsgPayload = { + data: { + multipleValues2: { + name: "Walter White", + subject: "Chemistry" + } + } + }; + check common:validateNextMessage(wsClient2, expectedMsgPayload); +} + +@test:Config { + groups: ["interceptors", "subscriptions"] +} +isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscription_interceptor5"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + json expectedMsgPayload = {data: {messages: 1}}; + foreach int i in 1 ..< 4 { + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } +} + +@test:Config { + groups: ["interceptors", "subscriptions"] +} +isolated function testInterceptorsDestructiveModificationWithSubscription() returns error? { + string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscription_interceptor6"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + check common:sendSubscriptionMessage(wsClient1, document, "1"); + + websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + check common:sendSubscriptionMessage(wsClient2, document, "2"); + + json expectedMsgPayload = { + errors: [ + { + message: "Invalid return type in Interceptor \"DestructiveModification\". Expected type Int!", + locations: [ + { + line: 1, + column: 16 + } + ], + path: [ + "messages" + ] + }, + { + message: "Invalid return type in Interceptor \"DestructiveModification\". Expected type Int!", + locations: [ + { + line: 1, + column: 16 + } + ], + path: ["messages"] + } + ], + data: null + }; + foreach int i in 1 ..< 4 { + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } +} + +@test:Config { + groups: ["interceptors", "subscriptions"] +} +isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns error? { + final string document = string `subscription { messages }`; + string url = "ws://localhost:9091/subscription_interceptor1"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + final websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + + final websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + + final websocket:Client wsClient3 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient3); + + worker A returns error? { + check common:sendSubscriptionMessage(wsClient1, document, "1"); + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + } + } + worker B returns error? { + check common:sendSubscriptionMessage(wsClient2, document, "2"); + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } + } + check common:sendSubscriptionMessage(wsClient3, document, "3"); + foreach int i in 1 ..< 4 { + json expectedMsgPayload = {data: {messages: (i * 5 - 5) * 5 - 5}}; + check common:validateNextMessage(wsClient3, expectedMsgPayload, id = "3"); + } + check wait A; + check wait B; +} + +@test:Config { + groups: ["interceptors", "union", "subscriptions"] +} +isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns error? { + final string document = check common:getGraphqlDocumentFromFile("interceptors_with_subscription_return_union_type"); + string url = "ws://localhost:9091/subscription_interceptor4"; + websocket:ClientConfiguration config = {subProtocols: [common:GRAPHQL_TRANSPORT_WS]}; + final websocket:Client wsClient1 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient1); + + final websocket:Client wsClient2 = check new (url, config); + check common:initiateGraphqlWsConnection(wsClient2); + + worker A returns error? { + check common:sendSubscriptionMessage(wsClient1, document, "1", operationName = "unionTypes1"); + json expectedMsgPayload = { + data: { + multipleValues1: { + id: 100, + name: "Jesse Pinkman" + } + } + }; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + expectedMsgPayload = { + data: { + multipleValues1: { + name: "Walter White", + subject: "Physics" + } + } + }; + check common:validateNextMessage(wsClient1, expectedMsgPayload, id = "1"); + } + worker B returns error? { + check common:sendSubscriptionMessage(wsClient2, document, "2", operationName = "unionTypes1"); + json expectedMsgPayload = { + data: { + multipleValues1: { + id: 100, + name: "Jesse Pinkman" + } + } + }; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + expectedMsgPayload = { + data: { + multipleValues1: { + name: "Walter White", + subject: "Physics" + } + } + }; + check common:validateNextMessage(wsClient2, expectedMsgPayload, id = "2"); + } + check wait A; + check wait B; +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/interceptors.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/interceptors.bal new file mode 100644 index 000000000..013878681 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/interceptors.bal @@ -0,0 +1,150 @@ +// Copyright (c) 2022, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +readonly service class Multiplication { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + var result = context.resolve('field); + if result is int { + return result * 5; + } + return result; + } +} + +readonly service class Subtraction { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + var result = context.resolve('field); + if result is int { + return result - 5; + } + return result; + } +} + +readonly service class InterceptAuthor { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + var result = context.resolve('field); + if 'field.getName() == "author" { + return "Athur Conan Doyle"; + } + return result; + } +} + +readonly service class InterceptBook { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + _ = context.resolve('field); + Book b = {name: "A Game of Thrones", author: "George R.R. Martin"}; + return b; + } +} + +readonly service class InterceptStudentName { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + var result = context.resolve('field); + if 'field.getName() == "name" { + return "Harry Potter"; + } + return result; + } +} + +readonly service class InterceptStudent { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + _ = context.resolve('field); + return {id: 4, name: "Ron Weasley"}; + } +} + +readonly service class InterceptUnionType1 { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + var result = context.resolve('field); + if 'field.getName() == "subject" { + return "Physics"; + } + if 'field.getName() == "id" { + return 100; + } + return result; + } +} + +readonly service class InterceptUnionType2 { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + _ = context.resolve('field); + return {id: 0, name: "Walter White", subject: "Chemistry"}; + } +} + +readonly service class ReturnBeforeResolver { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + return 1; + } +} + +@graphql:InterceptorConfig { + global: false +} +readonly service class DestructiveModification { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + _ = context.resolve('field); + return "Ballerina"; + } +} + +@graphql:InterceptorConfig { + global: false +} +readonly service class ServiceLevelInterceptor { + *graphql:Interceptor; + + isolated remote function execute(graphql:Context context, graphql:Field 'field) returns anydata|error { + if self.grantAccess('field.getName()) { + return context.resolve('field); + } + return error("Access denied!"); + } + + isolated function grantAccess(string fieldName) returns boolean { + string[] grantedFields = ["profile", "books", "setName", "person", "setAge", "customer", "newBooks", "updatePerson", "person"]; + if grantedFields.indexOf(fieldName) is int { + return true; + } + return false; + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/listeners.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/listeners.bal new file mode 100644 index 000000000..f9e09624a --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/listeners.bal @@ -0,0 +1,20 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +listener graphql:Listener basicListener = new (9090); +listener graphql:Listener subscriptionListener = new (9091); diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/object_types.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/object_types.bal new file mode 100644 index 000000000..c144f29ad --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/object_types.bal @@ -0,0 +1,106 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public type PeopleService StudentService|TeacherService; + +public distinct isolated service class StudentService { + private final int id; + private final string name; + + public isolated function init(int id, string name) { + self.id = id; + self.name = name; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + return self.name; + } +} + +public distinct isolated service class TeacherService { + private final int id; + private string name; + private string subject; + + public isolated function init(int id, string name, string subject) { + self.id = id; + self.name = name; + self.subject = subject; + } + + isolated resource function get id() returns int { + return self.id; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + isolated function setName(string name) { + lock { + self.name = name; + } + } + + isolated resource function get subject() returns string { + lock { + return self.subject; + } + } + + isolated function setSubject(string subject) { + lock { + self.subject = subject; + } + } + + isolated resource function get holidays() returns Weekday[] { + return [SATURDAY, SUNDAY]; + } + + isolated resource function get school() returns School { + return new School("CHEM"); + } +} + +public distinct isolated service class School { + private string name; + + public isolated function init(string name) { + self.name = name; + } + + isolated resource function get name() returns string { + lock { + return self.name; + } + } + + # Get the opening days of the school. + # + return - The set of the weekdays the school is open + # # Deprecated + # School is now online. + @deprecated + isolated resource function get openingDays() returns Weekday[] { + return [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY]; + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/records.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/records.bal new file mode 100644 index 000000000..5060b46be --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/records.bal @@ -0,0 +1,31 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public type Book readonly & record { + string name; + string author; +}; + + +public enum Weekday { + SUNDAY, + MONDAY, + TUESDAY, + WEDNESDAY, + THURSDAY, + FRIDAY, + SATURDAY +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/services.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/services.bal new file mode 100644 index 000000000..bb6285e26 --- /dev/null +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/services.bal @@ -0,0 +1,146 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/graphql; + +@graphql:ServiceConfig { + interceptors: [new DestructiveModification()] +} +isolated service /subscription_interceptor6 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + @graphql:ResourceConfig { + interceptors: new DestructiveModification() + } + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: new ReturnBeforeResolver() +} +isolated service /subscription_interceptor5 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: [new Subtraction(), new Multiplication()] +} +isolated service /subscription_interceptor1 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + @graphql:ResourceConfig { + interceptors: [new Subtraction(), new Multiplication()] + } + isolated resource function subscribe messages() returns stream { + int[] intArray = [1, 2, 3, 4, 5]; + return intArray.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: [new InterceptAuthor(), new ServiceLevelInterceptor()] +} +isolated service /subscription_interceptor2 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe books() returns stream { + Book?[] books = [ + {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, + {name: "A Game of Thrones", author: "George R.R. Martin"}, + () + ]; + return books.toStream(); + } + + @graphql:ResourceConfig { + interceptors: [new InterceptBook()] + } + isolated resource function subscribe newBooks() returns stream { + Book?[] books = [ + {name: "Crime and Punishment", author: "Fyodor Dostoevsky"}, + () + ]; + return books.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: new InterceptStudentName() +} +isolated service /subscription_interceptor3 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe students() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } + + @graphql:ResourceConfig { + interceptors: [new InterceptStudent()] + } + isolated resource function subscribe newStudents() returns stream { + StudentService[] students = [new StudentService(1, "Eren Yeager"), new StudentService(2, "Mikasa Ackerman")]; + return students.toStream(); + } +} + +@graphql:ServiceConfig { + interceptors: new InterceptUnionType1() +} +isolated service /subscription_interceptor4 on subscriptionListener { + + isolated resource function get name() returns string { + return "Walter White"; + } + + isolated resource function subscribe multipleValues1() returns stream|error { + StudentService s = new StudentService(1, "Jesse Pinkman"); + TeacherService t = new TeacherService(0, "Walter White", "Chemistry"); + return [s, t].toStream(); + } + + @graphql:ResourceConfig { + interceptors: new InterceptUnionType2() + } + isolated resource function subscribe multipleValues2() returns stream|error { + StudentService s = new StudentService(1, "Harry Potter"); + TeacherService t = new TeacherService(3, "Severus Snape", "Dark Arts"); + return [s, t].toStream(); + } +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal index cced36cc2..b812b29fb 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal @@ -113,7 +113,8 @@ isolated function testSubscriptionWithMultipleClients() returns error? { } @test:Config { - groups: ["subscriptions"] + groups: ["subscriptions"], + enable: false } isolated function testConnectionInitMessage() returns error? { string url = "ws://localhost:9091/subscriptions"; diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql similarity index 100% rename from ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql rename to ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/interceptors_with_fragments_and_subscription.graphql diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql similarity index 100% rename from ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql rename to ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/interceptors_with_subscription_return_records.graphql diff --git a/ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql b/ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql similarity index 100% rename from ballerina-tests/graphql-interceptor-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql rename to ballerina-tests/graphql-subscription-test-suite/tests/resources/documents/interceptors_with_subscription_return_union_type.graphql From ddf3481350bf8292d49736065bb1b3b51657c453 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Mon, 7 Oct 2024 11:17:41 +0530 Subject: [PATCH 14/15] Disable subscriptions test group on ubuntu --- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/pull-request.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 66ba1857c..06a7e2b7f 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -35,7 +35,7 @@ jobs: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} native_image_options: '-J-Xmx7G ${{ inputs.native_image_options }}' - additional_ubuntu_build_flags: '-x :graphql-compiler-plugin-tests:test' + additional_ubuntu_build_flags: '-x :graphql-compiler-plugin-tests:test -Pdisable=subscriptions' # TODO : Enable after fixing this issue : https://github.com/ballerina-platform/ballerina-lang/issues/38882 # additional_windows_build_flags: '-x :graphql-compiler-plugin-tests:test' additional_windows_build_flags: '-x test' diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d8c58cb4e..16c0689f2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -12,3 +12,5 @@ jobs: if: ${{ github.repository_owner == 'ballerina-platform' }} uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit + with: + additional-ubuntu-test-flags: "-Pdisable=subscriptions" From aeb8e8ecb4a98c28441beaee1416b27c5f9fe2a6 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Mon, 7 Oct 2024 11:28:49 +0530 Subject: [PATCH 15/15] Update README.md --- ballerina-tests/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/ballerina-tests/README.md b/ballerina-tests/README.md index 974b6a106..6a2dde251 100644 --- a/ballerina-tests/README.md +++ b/ballerina-tests/README.md @@ -13,8 +13,6 @@ The tests for the Ballerina GraphQL module are organized into multiple test suit ### Test Structure -### Test Structure - - **Listeners**: Test listeners are defined in the `/tests/listeners.bal` file. - **Services**: Test services are defined in the `/tests/services.bal` file. - **Records, Object Types, and Values**: Ballerina records, object types, and values are defined in the corresponding Ballerina files: