├── .dockerignore ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── actionlint.yml ├── labeler.yml ├── renovate.json └── workflows │ ├── cd-dgraph-nightly.yml │ ├── cd-dgraph.yml │ ├── ci-dgraph-core-tests.yml │ ├── ci-dgraph-core-upgrade-tests.yml │ ├── ci-dgraph-fuzz.yml │ ├── ci-dgraph-integration2-tests.yml │ ├── ci-dgraph-jepsen-tests.yml │ ├── ci-dgraph-ldbc-tests.yml │ ├── ci-dgraph-load-tests.yml │ ├── ci-dgraph-system-upgrade-tests.yml │ ├── ci-dgraph-systest-tests.yml │ ├── ci-dgraph-tests-arm64.yml │ ├── ci-dgraph-upgrade-fixed-versions-tests.yml │ ├── ci-dgraph-vector-tests.yml │ ├── codeql.yml │ ├── labeler.yml │ └── trunk.yml ├── .gitignore ├── .trunk ├── .gitignore ├── configs │ ├── .checkov.yaml │ ├── .golangci.json │ ├── .hadolint.yaml │ ├── .markdownlint.json │ ├── .prettierignore │ ├── .prettierrc │ ├── .shellcheckrc │ ├── .trivyignore.yaml │ └── .yamllint.yaml └── trunk.yaml ├── .vscode ├── extensions.json ├── launch.json └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md ├── SECURITY.md ├── acl ├── acl.go ├── acl_curl_test.go ├── acl_integration_test.go ├── acl_test.go ├── hmac-secret ├── integration_test.go ├── jwt_algo_test.go ├── run.go ├── upgrade_test.go └── utils.go ├── algo ├── benchmarks ├── cm-sketch.go ├── doc.go ├── heap.go ├── heap_test.go ├── packed.go ├── packed_test.go ├── uidlist.go └── uidlist_test.go ├── audit ├── audit.go ├── interceptor.go ├── run.go ├── run_test.go └── testfiles │ └── zero_audit_0_1.log.enc ├── backup └── run.go ├── check_upgrade ├── check_upgrade.go └── check_upgrade_test.go ├── chunker ├── README.txt ├── chunk.go ├── chunk_test.go ├── data.rdf ├── json_parser.go ├── json_parser_test.go ├── rdf_parser.go ├── rdf_parser_test.go └── rdf_state.go ├── codec ├── benchmark │ ├── .gitignore │ ├── benchmark.go │ └── clustered1M.bin.gz ├── codec.go └── codec_test.go ├── compose ├── .gitignore ├── Makefile ├── compose.go ├── prometheus.yml └── run.sh ├── conn ├── node.go ├── node_test.go ├── pool.go ├── raft_server.go └── snappy.go ├── contrib ├── Dockerfile ├── jepsen │ ├── .gitignore │ ├── Makefile │ ├── browser │ │ └── browser.go │ └── main.go └── standalone │ ├── Dockerfile │ ├── Makefile │ ├── hooks │ └── build │ └── run.sh ├── dgraph ├── .gitignore ├── Makefile ├── cmd │ ├── alpha │ │ ├── .gitignore │ │ ├── admin.go │ │ ├── dashboard.go │ │ ├── debug.yaml │ │ ├── http.go │ │ ├── http_test.go │ │ ├── metrics_test.go │ │ ├── mutations_mode │ │ │ ├── docker-compose.yml │ │ │ └── mutations_mode_test.go │ │ ├── notes.txt │ │ ├── reindex_test.go │ │ ├── run.go │ │ ├── run_test.go │ │ ├── schema_scalar │ │ ├── testdata.nq │ │ ├── testrun.sh │ │ ├── testrun │ │ │ ├── conf1.yaml │ │ │ ├── conf2.yaml │ │ │ └── conf3.yaml │ │ ├── thoughts.md │ │ ├── txn_test.go │ │ └── upsert_test.go │ ├── bulk │ │ ├── .gitignore │ │ ├── count_index.go │ │ ├── loader.go │ │ ├── mapper.go │ │ ├── merge_shards.go │ │ ├── progress.go │ │ ├── reduce.go │ │ ├── run.go │ │ ├── schema.go │ │ ├── shard_map.go │ │ ├── speed_tests │ │ │ ├── .gitignore │ │ │ └── run.sh │ │ ├── split_gz.sh │ │ └── systest │ │ │ ├── run.sh │ │ │ ├── suite01 │ │ │ ├── query.json │ │ │ ├── rdfs.rdf │ │ │ ├── result.json │ │ │ └── schema.txt │ │ │ ├── suite02 │ │ │ ├── query.json │ │ │ ├── rdfs.rdf │ │ │ ├── result.json │ │ │ └── schema.txt │ │ │ ├── suite03 │ │ │ ├── query.json │ │ │ ├── rdfs.rdf │ │ │ ├── result.json │ │ │ └── schema.txt │ │ │ └── test-bulk-schema.sh │ ├── cert │ │ ├── cert.go │ │ ├── create.go │ │ ├── info.go │ │ └── run.go │ ├── conv │ │ ├── conv.go │ │ └── run.go │ ├── debug │ │ ├── run.go │ │ └── wal.go │ ├── debuginfo │ │ ├── archive.go │ │ ├── debugging.go │ │ └── run.go │ ├── decrypt │ │ └── decrypt.go │ ├── dgraphimport │ │ ├── import_client.go │ │ └── import_test.go │ ├── increment │ │ ├── .gitignore │ │ ├── increment.go │ │ └── increment_test.go │ ├── live │ │ ├── .gitignore │ │ ├── batch.go │ │ ├── load-json │ │ │ ├── family.json │ │ │ ├── family.schema │ │ │ ├── family1.json │ │ │ ├── family2.json │ │ │ ├── family3.json │ │ │ └── load_test.go │ │ ├── load-uids │ │ │ ├── correct1.rdf │ │ │ ├── correct2.rdf │ │ │ ├── errored1.rdf │ │ │ ├── errored2.rdf │ │ │ ├── family.json │ │ │ ├── family.rdf │ │ │ ├── family.schema │ │ │ ├── load_test.go │ │ │ ├── xid.schema │ │ │ ├── xid_a.rdf │ │ │ └── xid_b.rdf │ │ └── run.go │ ├── mcp │ │ ├── README.md │ │ ├── mcp_server.go │ │ ├── mcp_server_sse_test.go │ │ ├── prompt.txt │ │ └── run.go │ ├── migrate │ │ ├── README.md │ │ ├── datatype.go │ │ ├── dump.go │ │ ├── run.go │ │ ├── table_guide.go │ │ ├── table_info.go │ │ └── utils.go │ ├── root.go │ ├── root_test.go │ ├── version │ │ ├── run.go │ │ └── version_test.go │ └── zero │ │ ├── .gitignore │ │ ├── assign.go │ │ ├── http.go │ │ ├── oracle.go │ │ ├── raft.go │ │ ├── run.go │ │ ├── tablet.go │ │ ├── zero.go │ │ └── zero_test.go ├── docker-compose.yml ├── main.go ├── main_test.go └── minio.env ├── dgraphapi ├── acl.go ├── cluster.go ├── json.go ├── schema.go ├── snapshot.go └── vector.go ├── dgraphtest ├── .gitignore ├── README.md ├── compose_cluster.go ├── config.go ├── dcloud_cluster.go ├── dgraph.go ├── image.go ├── load.go ├── local_cluster.go └── paths.go ├── dql ├── README.md ├── bench_test.go ├── dql.go ├── dql_test.go ├── fuzz-data │ └── corpus.tar.gz ├── math.go ├── mutation.go ├── parser.go ├── parser_fuzz_test.go ├── parser_mutation.go ├── parser_test.go ├── state.go ├── state_test.go └── upsert_test.go ├── edgraph ├── access.go ├── access_test.go ├── alter.go ├── alter_test.go ├── config_mem.go ├── graphql.go ├── multi_tenancy.go ├── namespace.go ├── namespace_test.go ├── ns_query_no_acl_test.go ├── query.go ├── server.go ├── server_test.go └── zero.go ├── enc ├── test-fixtures │ ├── bad-length-enc-key │ ├── dgraph.hcl │ ├── dummy_role_id_file │ ├── dummy_secret_id_file │ └── enc-key └── util.go ├── filestore ├── filestore.go ├── local_files.go └── remote_files.go ├── go.mod ├── go.sum ├── graphql ├── admin │ ├── add_group.go │ ├── admin.go │ ├── assign.go │ ├── backup.go │ ├── config.go │ ├── current_user.go │ ├── draining.go │ ├── endpoints.go │ ├── export.go │ ├── health.go │ ├── http.go │ ├── list_backups.go │ ├── login.go │ ├── moveTablet.go │ ├── namespace.go │ ├── removeNode.go │ ├── reset_password.go │ ├── restore.go │ ├── schema.go │ ├── shutdown.go │ ├── state.go │ ├── task.go │ └── update_group.go ├── api │ └── panics.go ├── authorization │ ├── auth.go │ └── utils.go ├── bench │ ├── README.md │ ├── auth_test.go │ ├── schema.graphql │ └── schema_auth.graphql ├── dgraph │ ├── execute.go │ └── graphquery.go ├── e2e │ ├── admin_auth │ │ ├── poorman_auth │ │ │ ├── admin_auth_test.go │ │ │ └── docker-compose.yml │ │ └── poorman_auth_with_acl │ │ │ ├── admin_auth_test.go │ │ │ └── docker-compose.yml │ ├── auth │ │ ├── add_mutation_test.go │ │ ├── auth_test.go │ │ ├── debug_off │ │ │ ├── debugoff_test.go │ │ │ └── docker-compose.yml │ │ ├── delete_mutation_test.go │ │ ├── docker-compose.yml │ │ ├── sample_private_key.pem │ │ ├── sample_public_key.pem │ │ ├── schema.graphql │ │ ├── test_data.json │ │ └── update_mutation_test.go │ ├── auth_closed_by_default │ │ ├── auth_closed_by_default_test.go │ │ └── docker-compose.yml │ ├── common │ │ ├── README.md │ │ ├── admin.go │ │ ├── common.go │ │ ├── error.go │ │ ├── error_test.yaml │ │ ├── fragment.go │ │ ├── lambda.go │ │ ├── mutation.go │ │ ├── query.go │ │ ├── schema.go │ │ └── subscription.go │ ├── custom_logic │ │ ├── README.md │ │ ├── cmd │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── graphqlresponse.yaml │ │ │ ├── index.js │ │ │ ├── main.go │ │ │ ├── package-lock.json │ │ │ └── package.json │ │ ├── custom_logic_test.go │ │ ├── docker-compose.yml │ │ └── schemas │ │ │ ├── batch-mode-graphql.graphql │ │ │ ├── batch-mode-rest.graphql │ │ │ ├── mixed-modes.graphql │ │ │ ├── single-mode-graphql.graphql │ │ │ └── single-mode-rest.graphql │ ├── directives │ │ ├── dgraph_directives_test.go │ │ ├── docker-compose.yml │ │ ├── schema.graphql │ │ ├── schema_response.json │ │ ├── script.js │ │ └── test_data.json │ ├── multi_tenancy │ │ ├── docker-compose.yml │ │ └── multi_tenancy_test.go │ ├── normal │ │ ├── docker-compose.yml │ │ ├── normal_test.go │ │ ├── schema.graphql │ │ ├── schema_response.json │ │ ├── script.js │ │ └── test_data.json │ ├── schema │ │ ├── apollo_service_response.graphql │ │ ├── docker-compose.yml │ │ ├── generatedSchema.graphql │ │ └── schema_test.go │ └── subscription │ │ ├── docker-compose.yml │ │ └── subscription_test.go ├── resolve │ ├── add_mutation_test.yaml │ ├── auth_add_test.yaml │ ├── auth_closed_by_default_add_test.yaml │ ├── auth_closed_by_default_delete_test.yaml │ ├── auth_closed_by_default_query_test.yaml │ ├── auth_closed_by_default_update_test.yaml │ ├── auth_delete_test.yaml │ ├── auth_query_test.yaml │ ├── auth_test.go │ ├── auth_tests.yaml │ ├── auth_update_test.yaml │ ├── custom_mutation_test.yaml │ ├── custom_query_test.yaml │ ├── delete_mutation_test.yaml │ ├── extensions_test.go │ ├── middlewares.go │ ├── middlewares_test.go │ ├── mutation.go │ ├── mutation_query_test.yaml │ ├── mutation_rewriter.go │ ├── mutation_test.go │ ├── query.go │ ├── query_rewriter.go │ ├── query_test.go │ ├── query_test.yaml │ ├── resolver.go │ ├── resolver_error_test.go │ ├── resolver_error_test.yaml │ ├── resolver_test.go │ ├── schema.graphql │ ├── update_mutation_test.yaml │ ├── validate_mutation_test.yaml │ └── webhook.go ├── run.go ├── schema │ ├── auth.go │ ├── auth_schemas_test.yaml │ ├── completion.go │ ├── custom_http.go │ ├── custom_http_config_test.yaml │ ├── dgraph_schemagen_test.yml │ ├── errors.go │ ├── errors_test.go │ ├── gqlschema.go │ ├── gqlschema_test.yml │ ├── introspection.go │ ├── remote.go │ ├── remote_test.go │ ├── request.go │ ├── response.go │ ├── response_test.go │ ├── rules.go │ ├── schemagen.go │ ├── schemagen_test.go │ ├── testdata │ │ ├── apolloservice │ │ │ ├── input │ │ │ │ ├── auth-directive.graphql │ │ │ │ ├── custom-directive.graphql │ │ │ │ ├── extended-types.graphql │ │ │ │ ├── generate-directive.graphql │ │ │ │ └── single-extended-type.graphql │ │ │ └── output │ │ │ │ ├── auth-directive.graphql │ │ │ │ ├── custom-directive.graphql │ │ │ │ ├── extended-types.graphql │ │ │ │ ├── generate-directive.graphql │ │ │ │ └── single-extended-type.graphql │ │ ├── introspection │ │ │ ├── input │ │ │ │ ├── enum_withdeprecated.txt │ │ │ │ ├── enum_withoutdeprecated.txt │ │ │ │ ├── full_query.graphql │ │ │ │ ├── type_complex_object_name_filter.txt │ │ │ │ ├── type_filter.txt │ │ │ │ ├── type_object_name_filter.txt │ │ │ │ ├── type_schema_filter.txt │ │ │ │ ├── type_withdeprecated.txt │ │ │ │ └── type_withoutdeprecated.txt │ │ │ └── output │ │ │ │ ├── enum_withdeprecated.json │ │ │ │ ├── enum_withoutdeprecated.json │ │ │ │ ├── full_query.json │ │ │ │ ├── type_complex_object_name_filter.json │ │ │ │ ├── type_filter.json │ │ │ │ ├── type_object_name_filter.json │ │ │ │ ├── type_schema_filter.json │ │ │ │ ├── type_withdeprecated.json │ │ │ │ └── type_withoutdeprecated.json │ │ └── schemagen │ │ │ ├── input │ │ │ ├── apollo-federation.graphql │ │ │ ├── auth-on-interfaces.graphql │ │ │ ├── authorization.graphql │ │ │ ├── comments-and-descriptions.graphql │ │ │ ├── created-updated-directives.graphql │ │ │ ├── custom-dql-query-with-subscription.graphql │ │ │ ├── custom-mutation.graphql │ │ │ ├── custom-nested-types.graphql │ │ │ ├── custom-query-mixed-types.graphql │ │ │ ├── custom-query-not-dgraph-type.graphql │ │ │ ├── custom-query-with-dgraph-type.graphql │ │ │ ├── deprecated.graphql │ │ │ ├── dgraph-reverse-directive-on-concrete-type-with-interfaces.graphql │ │ │ ├── dgraph-reverse-directive-with-interfaces.graphql │ │ │ ├── embedding-directive-with-similar-queries.graphql │ │ │ ├── field-with-id-directive.graphql │ │ │ ├── field-with-multiple-@id-fields.graphql │ │ │ ├── field-with-reverse-predicate-in-dgraph-directive.graphql │ │ │ ├── filter-cleanSchema-all-empty.graphql │ │ │ ├── filter-cleanSchema-circular.graphql │ │ │ ├── filter-cleanSchema-custom-mutation.graphql │ │ │ ├── filter-cleanSchema-directLink.graphql │ │ │ ├── generate-directive.graphql │ │ │ ├── geo-type.graphql │ │ │ ├── hasInverse-with-interface-having-directive.graphql │ │ │ ├── hasInverse-with-interface.graphql │ │ │ ├── hasInverse-with-type-having-directive.graphql │ │ │ ├── hasInverse.graphql │ │ │ ├── hasInverse_withSubscription.graphql │ │ │ ├── hasfilter.graphql │ │ │ ├── ignore-unsupported-directive.graphql │ │ │ ├── interface-with-dgraph-pred.graphql │ │ │ ├── interface-with-id-directive.graphql │ │ │ ├── interface-with-no-ids.graphql │ │ │ ├── interfaces-with-types-and-password.graphql │ │ │ ├── interfaces-with-types.graphql │ │ │ ├── lambda-directive.graphql │ │ │ ├── language-tags.graphql │ │ │ ├── no-id-field-with-searchables.graphql │ │ │ ├── no-id-field.graphql │ │ │ ├── password-type.graphql │ │ │ ├── searchables-references.graphql │ │ │ ├── searchables.graphql │ │ │ ├── single-type-with-enum.graphql │ │ │ ├── single-type.graphql │ │ │ ├── type-implements-multiple-interfaces.graphql │ │ │ ├── type-reference.graphql │ │ │ ├── type-with-arguments-on-field.graphql │ │ │ ├── type-with-custom-field-on-dgraph-type.graphql │ │ │ ├── type-with-custom-fields-on-remote-type.graphql │ │ │ ├── type-without-orderables.graphql │ │ │ └── union.graphql │ │ │ └── output │ │ │ ├── apollo-federation.graphql │ │ │ ├── auth-on-interfaces.graphql │ │ │ ├── authorization.graphql │ │ │ ├── comments-and-descriptions.graphql │ │ │ ├── created-updated-directives.graphql │ │ │ ├── custom-dql-query-with-subscription.graphql │ │ │ ├── custom-mutation.graphql │ │ │ ├── custom-nested-types.graphql │ │ │ ├── custom-query-mixed-types.graphql │ │ │ ├── custom-query-not-dgraph-type.graphql │ │ │ ├── custom-query-with-dgraph-type.graphql │ │ │ ├── deprecated.graphql │ │ │ ├── dgraph-reverse-directive-on-concrete-type-with-interfaces.graphql │ │ │ ├── dgraph-reverse-directive-with-interfaces.graphql │ │ │ ├── embedding-directive-with-similar-queries.graphql │ │ │ ├── field-with-id-directive.graphql │ │ │ ├── field-with-multiple-@id-fields.graphql │ │ │ ├── field-with-reverse-predicate-in-dgraph-directive.graphql │ │ │ ├── filter-cleanSchema-all-empty.graphql │ │ │ ├── filter-cleanSchema-circular.graphql │ │ │ ├── filter-cleanSchema-custom-mutation.graphql │ │ │ ├── filter-cleanSchema-directLink.graphql │ │ │ ├── generate-directive.graphql │ │ │ ├── geo-type.graphql │ │ │ ├── hasInverse-with-interface-having-directive.graphql │ │ │ ├── hasInverse-with-interface.graphql │ │ │ ├── hasInverse-with-type-having-directive.graphql │ │ │ ├── hasInverse.graphql │ │ │ ├── hasInverse_withSubscription.graphql │ │ │ ├── hasfilter.graphql │ │ │ ├── ignore-unsupported-directive.graphql │ │ │ ├── interface-with-dgraph-pred.graphql │ │ │ ├── interface-with-id-directive.graphql │ │ │ ├── interface-with-no-ids.graphql │ │ │ ├── interfaces-with-types-and-password.graphql │ │ │ ├── interfaces-with-types.graphql │ │ │ ├── lambda-directive.graphql │ │ │ ├── language-tags.graphql │ │ │ ├── no-id-field-with-searchables.graphql │ │ │ ├── no-id-field.graphql │ │ │ ├── password-type.graphql │ │ │ ├── random.graphql │ │ │ ├── searchables-references.graphql │ │ │ ├── searchables.graphql │ │ │ ├── single-type-with-enum.graphql │ │ │ ├── single-type.graphql │ │ │ ├── type-implements-multiple-interfaces.graphql │ │ │ ├── type-reference.graphql │ │ │ ├── type-with-arguments-on-field.graphql │ │ │ ├── type-with-custom-field-on-dgraph-type.graphql │ │ │ ├── type-with-custom-fields-on-remote-type.graphql │ │ │ ├── type-without-orderables.graphql │ │ │ └── union.graphql │ ├── validation_rules.go │ ├── wrappers.go │ └── wrappers_test.go ├── subscription │ └── poller.go ├── test │ └── test.go └── testdata │ ├── custom_bench │ ├── README.md │ ├── dgraph_api_server.go │ └── profiling │ │ ├── benchmarks │ │ ├── 0 │ │ │ ├── queries │ │ │ │ ├── 00.query │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ ├── 22.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 1_batch │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13.query │ │ │ │ ├── 13_small.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 1_single │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13.query │ │ │ │ ├── 13_small.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 2_batch │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13.query │ │ │ │ ├── 13_small.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 2_single │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13.query │ │ │ │ ├── 13_small.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 3_batch │ │ │ ├── queries │ │ │ │ ├── 02_small.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 3_single │ │ │ ├── queries │ │ │ │ ├── 02_small.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 4_batch │ │ │ ├── queries │ │ │ │ ├── 02_small.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 4_single │ │ │ ├── queries │ │ │ │ ├── 02_small.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 5_batch │ │ │ ├── queries │ │ │ │ ├── 00.query │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 5_single │ │ │ ├── queries │ │ │ │ ├── 00.query │ │ │ │ ├── 01.query │ │ │ │ ├── 02.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 6_batch │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 6_single │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 7_batch │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 7_single │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 10.query │ │ │ │ ├── 11.query │ │ │ │ ├── 12_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 20.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── 8_batch │ │ │ ├── queries │ │ │ │ ├── 01.query │ │ │ │ ├── 02_small.query │ │ │ │ ├── 13_small.query │ │ │ │ ├── 21.query │ │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ └── 8_single │ │ │ ├── queries │ │ │ ├── 01.query │ │ │ ├── 02_small.query │ │ │ ├── 13_small.query │ │ │ ├── 21.query │ │ │ └── 22_small.query │ │ │ └── schema.graphql │ │ ├── docker-compose.yml │ │ └── graphql_profiler.go │ └── datagen │ ├── LICENSE │ ├── README.md │ ├── cmd │ ├── root.go │ └── run.go │ ├── conf.yaml │ ├── data │ └── zomato-restaurants-data.zip │ ├── main.go │ └── schema.graphql ├── lex ├── iri.go ├── iri_test.go └── lexer.go ├── logo-dark.png ├── logo.png ├── ocagent ├── docker-compose.yml └── ocagent-config.yaml ├── paper ├── .gitignore ├── README ├── architecture.png ├── datasharding.png ├── dgraph.bib ├── dgraph.pdf ├── dgraph.tex ├── integerstorage.png ├── maxassigned-derivation.png ├── maxassigned.png ├── mvcc.png ├── posting.png └── usenix2019_v3.sty ├── posting ├── config.go ├── doc.go ├── index.go ├── index_test.go ├── list.go ├── list_test.go ├── lists.go ├── lmap_test.go ├── mvcc.go ├── mvcc_test.go ├── oracle.go ├── size.go ├── size_test.go ├── size_test.sh ├── stats.go ├── writer.go └── writer_test.go ├── protos ├── Makefile ├── depcheck.sh ├── patch_pb.sh ├── pb.proto ├── pb │ ├── pb.pb.go │ ├── pb_grpc.pb.go │ └── sensitive.go └── protos_test.go ├── query ├── .gitignore ├── aggregator.go ├── arena.go ├── benchmark │ ├── README.md │ ├── README.txt │ ├── actor.0.gob │ ├── actor.1.gob │ ├── actor.2.gob │ ├── director.0.gob │ ├── director.1.gob │ ├── director.2.gob │ ├── run.sh │ └── synthetic_results.txt ├── benchmark_test.go ├── cloud_test.go ├── common_test.go ├── fastjson_test.go ├── groupby.go ├── integration_test.go ├── math.go ├── math_test.go ├── mutation.go ├── mutation_test.go ├── normalize_feature_flag_test.go ├── outputnode.go ├── outputnode_graphql.go ├── outputnode_test.go ├── outputrdf.go ├── query.go ├── query0_test.go ├── query1_test.go ├── query2_test.go ├── query3_test.go ├── query4_test.go ├── query_facets_test.go ├── rdf_result_test.go ├── recurse.go ├── shortest.go ├── tables.go ├── test_schema ├── testdata │ ├── a.txt │ └── us-coordinates.txt ├── thoughts.md ├── upgrade_test.go └── vector │ ├── integration_test.go │ ├── vector_graphql_test.go │ └── vector_test.go ├── raftwal ├── encryption_test.go ├── log.go ├── meta.go ├── storage.go ├── storage_test.go └── wal.go ├── schema ├── parse.go ├── parse_test.go ├── schema.go ├── schema_test.go └── state.go ├── systest ├── .gitignore ├── 1million │ ├── 1million_test.go │ ├── alpha.yml │ ├── common │ │ └── tc.go │ ├── docker-compose.yml │ └── test-reindex.sh ├── 21million │ ├── bulk │ │ ├── alpha.yml │ │ ├── docker-compose.yml │ │ └── run_test.go │ ├── common │ │ └── run_queries.go │ ├── live │ │ ├── docker-compose.yml │ │ └── run_test.go │ ├── queries │ │ ├── query-001 │ │ ├── query-002 │ │ ├── query-003 │ │ ├── query-004 │ │ ├── query-005 │ │ ├── query-006 │ │ ├── query-007 │ │ ├── query-008 │ │ ├── query-009 │ │ ├── query-010 │ │ ├── query-011 │ │ ├── query-012 │ │ ├── query-013 │ │ ├── query-014 │ │ ├── query-015 │ │ ├── query-016 │ │ ├── query-017 │ │ ├── query-018 │ │ ├── query-019 │ │ ├── query-020 │ │ ├── query-021 │ │ ├── query-022 │ │ ├── query-024 │ │ ├── query-025 │ │ ├── query-026 │ │ ├── query-027 │ │ ├── query-028 │ │ ├── query-029 │ │ ├── query-030 │ │ ├── query-031 │ │ ├── query-032 │ │ ├── query-033 │ │ ├── query-034 │ │ ├── query-035 │ │ ├── query-036 │ │ ├── query-037 │ │ ├── query-038 │ │ ├── query-039 │ │ ├── query-040 │ │ ├── query-041 │ │ ├── query-042 │ │ ├── query-043 │ │ ├── query-044 │ │ ├── query-045 │ │ ├── query-046 │ │ ├── query-047 │ │ ├── query-048 │ │ ├── query-050 │ │ ├── query-051 │ │ ├── query-053 │ │ ├── query-054 │ │ ├── query-055 │ │ ├── query-056 │ │ ├── query-057 │ │ ├── query-058 │ │ ├── query-059 │ │ ├── query-060 │ │ ├── query-061 │ │ ├── query-062 │ │ ├── query-063 │ │ ├── query-064 │ │ ├── query-065 │ │ ├── query-066 │ │ ├── query-067 │ │ ├── query-068 │ │ ├── query-069 │ │ ├── query-070 │ │ ├── query-071 │ │ └── query-072 │ └── test-21million.sh ├── acl │ └── restore │ │ ├── acl-secret │ │ ├── acl_restore_test.go │ │ ├── data │ │ └── backups │ │ │ ├── dgraph.20210730.124449.146 │ │ │ └── r21-g1.backup │ │ │ └── manifest.json │ │ └── docker-compose.yml ├── audit │ ├── audit_dir │ │ ├── .gitkeep │ │ ├── aa │ │ │ └── .gitkeep │ │ └── za │ │ │ └── .gitkeep │ ├── audit_test.go │ └── docker-compose.yml ├── audit_encrypted │ ├── audit_dir │ │ ├── .gitkeep │ │ ├── aa │ │ │ └── .gitkeep │ │ └── za │ │ │ └── .gitkeep │ ├── audit_dir_deprecated │ │ ├── aa │ │ │ └── alpha_audit_1_1.log.enc │ │ └── za │ │ │ └── zero_audit_0_1.log.enc │ ├── audit_test.go │ └── docker-compose.yml ├── backup.env ├── backup │ ├── advanced-scenarios │ │ ├── 127-Namespace │ │ │ ├── backup_test.go │ │ │ └── docker-compose.yml │ │ ├── acl-nonAcl │ │ │ ├── backup_test.go │ │ │ └── docker-compose.yml │ │ └── deleted-namespace │ │ │ ├── backup_test.go │ │ │ └── docker-compose.yml │ ├── common │ │ └── utils.go │ ├── encryption │ │ ├── backup_test.go │ │ └── docker-compose.yml │ ├── filesystem │ │ ├── backup_test.go │ │ ├── data │ │ │ ├── .gitkeep │ │ │ ├── backups │ │ │ │ └── .gitkeep │ │ │ └── to_restore │ │ │ │ ├── 1 │ │ │ │ └── dgraph.20201125.173944.587 │ │ │ │ │ ├── manifest.json │ │ │ │ │ ├── r68-g1.backup │ │ │ │ │ ├── r68-g2.backup │ │ │ │ │ └── r68-g3.backup │ │ │ │ ├── 2 │ │ │ │ ├── dgraph.20210517.094442.220 │ │ │ │ │ ├── manifest.json │ │ │ │ │ ├── r38-g1.backup │ │ │ │ │ ├── r38-g2.backup │ │ │ │ │ └── r38-g3.backup │ │ │ │ ├── dgraph.20210517.094634.533 │ │ │ │ │ ├── manifest.json │ │ │ │ │ ├── r54-g1.backup │ │ │ │ │ ├── r54-g2.backup │ │ │ │ │ └── r54-g3.backup │ │ │ │ └── dgraph.20210517.094648.003 │ │ │ │ │ ├── manifest.json │ │ │ │ │ ├── r58-g1.backup │ │ │ │ │ ├── r58-g2.backup │ │ │ │ │ └── r58-g3.backup │ │ │ │ └── 3 │ │ │ │ ├── dgraph.20210517.095641.969 │ │ │ │ ├── r9-g1.backup │ │ │ │ ├── r9-g2.backup │ │ │ │ └── r9-g3.backup │ │ │ │ ├── dgraph.20210517.095716.130 │ │ │ │ ├── r21-g1.backup │ │ │ │ ├── r21-g2.backup │ │ │ │ └── r21-g3.backup │ │ │ │ ├── dgraph.20210517.095726.320 │ │ │ │ ├── r26-g1.backup │ │ │ │ ├── r26-g2.backup │ │ │ │ └── r26-g3.backup │ │ │ │ └── manifest.json │ │ └── docker-compose.yml │ ├── minio-large │ │ ├── backup_test.go │ │ └── docker-compose.yml │ ├── minio │ │ ├── backup_test.go │ │ └── docker-compose.yml │ ├── multi-tenancy │ │ ├── acl-secret │ │ ├── backup_test.go │ │ ├── data │ │ │ ├── .gitkeep │ │ │ └── backups │ │ │ │ └── .gitkeep │ │ └── docker-compose.yml │ └── nfs-backup │ │ ├── Dockerfile │ │ ├── backup_test.go │ │ └── docker-compose.yml ├── bgindex │ ├── common_test.go │ ├── count_test.go │ ├── docker-compose.yml │ ├── parallel_test.go │ ├── reverse_test.go │ ├── string_test.go │ └── test-bgindex.sh ├── bulk_live │ ├── bulk │ │ ├── alpha.yml │ │ ├── alpha_acl.yml │ │ ├── bulk_test.go │ │ └── docker-compose.yml │ ├── common │ │ ├── bulk_live_cases.go │ │ └── bulk_live_fixture.go │ └── live │ │ ├── docker-compose.yml │ │ └── live_test.go ├── cdc │ ├── cdc_logs │ │ └── .gitkeep │ ├── cdc_test.go │ └── docker-compose.yml ├── cloud │ ├── cloud_test.go │ └── docker-compose.yml ├── data │ ├── goldendata.rdf.gz │ ├── goldendata.schema │ ├── goldendata_export.rdf.gz │ └── goldendata_first_200k.rdf.gz ├── export │ ├── docker-compose.yml │ ├── export.env │ └── export_test.go ├── group-delete │ ├── README.md │ ├── docker-compose.yml │ └── group_delete_test.go ├── integration2 │ ├── acl_test.go │ ├── bulk_loader_test.go │ ├── graphql_schema_auth_test.go │ ├── incremental_restore_test.go │ └── snapshot_test.go ├── ldbc │ ├── alpha.yml │ ├── docker-compose.yml │ ├── ldbc_test.go │ └── test_cases.yaml ├── live_pw_test.go ├── loader-benchmark │ ├── docker-compose.yml │ └── loader-benchmark.sh ├── loader │ ├── docker-compose.yml │ ├── loader_test.go │ └── testdata │ │ ├── first.rdf.gz │ │ └── second.rdf.gz ├── multi-tenancy │ ├── basic_test.go │ ├── docker-compose.yml │ ├── integration_basic_helper_test.go │ ├── integration_test.go │ ├── login_test.go │ └── upgrade_test.go ├── mutations-and-queries │ ├── integration_test.go │ ├── mutations_test.go │ ├── queries_test.go │ └── upgrade_test.go ├── online-restore │ ├── backup │ │ ├── backups │ │ │ ├── dgraph.20200617.210005.792 │ │ │ │ ├── manifest.json │ │ │ │ ├── r30-g1.backup │ │ │ │ └── r30-g2.backup │ │ │ ├── dgraph.20200617.210012.038 │ │ │ │ ├── manifest.json │ │ │ │ ├── r30-g1.backup │ │ │ │ └── r30-g2.backup │ │ │ ├── dgraph.20200617.210106.464 │ │ │ │ ├── manifest.json │ │ │ │ ├── r28-g1.backup │ │ │ │ └── r28-g2.backup │ │ │ ├── dgraph.20200617.210343.124 │ │ │ │ ├── manifest.json │ │ │ │ ├── r2117-g1.backup │ │ │ │ └── r2117-g2.backup │ │ │ └── dgraph.20200617.212208.094 │ │ │ │ ├── manifest.json │ │ │ │ ├── r37-g1.backup │ │ │ │ └── r37-g2.backup │ │ └── backups2011 │ │ │ ├── dgraph.20210706.130427.532 │ │ │ ├── manifest.json │ │ │ ├── r55-g1.backup │ │ │ └── r55-g2.backup │ │ │ ├── dgraph.20210706.130444.413 │ │ │ ├── manifest.json │ │ │ ├── r58-g1.backup │ │ │ └── r58-g2.backup │ │ │ ├── dgraph.20210706.130453.552 │ │ │ ├── manifest.json │ │ │ ├── r68-g1.backup │ │ │ └── r68-g2.backup │ │ │ ├── dgraph.20210706.130519.083 │ │ │ ├── manifest.json │ │ │ ├── r72-g1.backup │ │ │ └── r72-g2.backup │ │ │ ├── dgraph.20210706.130544.666 │ │ │ ├── manifest.json │ │ │ ├── r86-g1.backup │ │ │ └── r86-g2.backup │ │ │ └── dgraph.20210706.130634.385 │ │ │ ├── manifest.json │ │ │ ├── r104-g1.backup │ │ │ └── r104-g2.backup │ ├── docker-compose.yml │ ├── keys │ │ └── enc_key │ ├── namespace-aware │ │ └── restore_test.go │ ├── online_restore_test.go │ └── queries │ │ ├── query-001 │ │ ├── query-002 │ │ ├── query-003 │ │ ├── query-004 │ │ └── query-005 ├── plugin │ ├── docker-compose.yml │ ├── integration_test.go │ ├── plugin_test.go │ └── upgrade_test.go ├── posting-list-benchmark │ └── main.go ├── shortest-path │ ├── graph.rdf.gz │ ├── graph.schema.gz │ └── shortest_test.go ├── unique_test.go └── vector │ ├── backup_test.go │ ├── load_test.go │ └── vector_test.go ├── t ├── .gitignore ├── Makefile ├── README.md └── t.go ├── task └── conversion.go ├── testutil ├── README.md ├── backup.go ├── bulk.go ├── client.go ├── custom_plugins │ ├── anagram │ │ └── main.go │ ├── cidr │ │ ├── main.go │ │ └── main_test.go │ ├── factor │ │ └── main.go │ └── rune │ │ └── main.go ├── docker.go ├── exec.go ├── graphql.go ├── json.go ├── minio.go ├── multi_tenancy.go ├── plugin.go ├── schema.go ├── testaudit │ ├── audit.go │ └── docker-compose.yml ├── utils.go └── zero.go ├── tlstest ├── acl │ ├── acl_over_tls_test.go │ └── docker-compose.yml ├── certrequest │ ├── certrequest_test.go │ └── docker-compose.yml ├── certrequireandverify │ ├── certrequireandverify_test.go │ └── docker-compose.yml ├── certverifyifgiven │ ├── certverifyifgiven_test.go │ └── docker-compose.yml ├── mtls_internal │ ├── ha_6_node │ │ ├── docker-compose.yml │ │ └── ha_test.go │ ├── multi_group │ │ ├── docker-compose.yml │ │ └── multi_group_test.go │ ├── single_node │ │ ├── docker-compose.yml │ │ └── single_node_test.go │ └── tls │ │ ├── alpha1 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.alpha1.crt │ │ ├── client.alpha1.key │ │ ├── node.crt │ │ └── node.key │ │ ├── alpha2 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.alpha2.crt │ │ ├── client.alpha2.key │ │ ├── node.crt │ │ └── node.key │ │ ├── alpha3 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.alpha3.crt │ │ ├── client.alpha3.key │ │ ├── node.crt │ │ └── node.key │ │ ├── alpha4 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.alpha4.crt │ │ ├── client.alpha4.key │ │ ├── node.crt │ │ └── node.key │ │ ├── alpha5 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.alpha5.crt │ │ ├── client.alpha5.key │ │ ├── node.crt │ │ └── node.key │ │ ├── alpha6 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.alpha6.crt │ │ ├── client.alpha6.key │ │ ├── node.crt │ │ └── node.key │ │ ├── live │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.liveclient.crt │ │ └── client.liveclient.key │ │ ├── zero1 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.zero1.crt │ │ ├── client.zero1.key │ │ ├── node.crt │ │ └── node.key │ │ ├── zero2 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.zero2.crt │ │ ├── client.zero2.key │ │ ├── node.crt │ │ └── node.key │ │ └── zero3 │ │ ├── ca.crt │ │ ├── ca.key │ │ ├── client.zero3.crt │ │ ├── client.zero3.key │ │ ├── node.crt │ │ └── node.key ├── tls │ ├── ca.crt │ ├── ca.key │ ├── client.acl.crt │ ├── client.acl.key │ ├── node.crt │ └── node.key └── zero_https │ ├── all_routes_tls │ ├── all_routes_tls_test.go │ └── docker-compose.yml │ └── no_tls │ ├── docker-compose.yml │ └── no_tls_test.go ├── tok ├── bleve.go ├── constraints │ └── constraints.go ├── hnsw │ ├── heap.go │ ├── helper.go │ ├── persistent_factory.go │ ├── persistent_hnsw.go │ ├── persistent_hnsw_test.go │ ├── search_layer.go │ └── test_helper.go ├── index │ ├── helper.go │ ├── helper_test.go │ ├── index.go │ ├── search_path.go │ └── types.go ├── index_factory.go ├── langbase.go ├── langbase_test.go ├── options │ ├── README.md │ ├── allowed_options.go │ ├── option_parser.go │ ├── options.go │ └── options_test.go ├── stemmers.go ├── stemmers_test.go ├── stopwords.go ├── stopwords_test.go ├── tok.go ├── tok_test.go └── tokens.go ├── types ├── compare.go ├── conversion.go ├── conversion_test.go ├── earth.go ├── facets │ ├── facet_types.go │ └── utils.go ├── geo_test.go ├── geofilter.go ├── geofilter_test.go ├── password.go ├── password_test.go ├── s2.go ├── s2_test.go ├── s2index.go ├── s2index_test.go ├── scalar_types.go ├── scalar_types_test.go ├── select.go ├── sort.go ├── sort_test.go ├── testdata │ ├── aruba.json │ ├── sudan.json │ ├── us.json │ └── zip.json ├── value.go └── value_test.go ├── upgrade ├── change_list.go ├── change_v20.03.0.go ├── change_v20.07.0.go ├── change_v21.03.0.go ├── doc.go ├── upgrade.go ├── upgrade_test.go ├── utils.go └── utils_test.go ├── worker ├── README.md ├── acl_cache.go ├── acl_cache_test.go ├── aggregator.go ├── backup.go ├── backup_handler.go ├── backup_manifest.go ├── cdc.go ├── compare.go ├── config.go ├── docker-compose.yml ├── draft.go ├── draft_test.go ├── embedded.go ├── export.go ├── export_test.go ├── graphql_schema.go ├── groups.go ├── import.go ├── match.go ├── match_test.go ├── multi_tenancy.go ├── mutation.go ├── mutation_integration_test.go ├── mutation_unit_test.go ├── online_restore.go ├── predicate_move.go ├── predicate_test.go ├── proposal.go ├── proposal_test.go ├── queue.go ├── restore_map.go ├── restore_reduce.go ├── schema.go ├── server_state.go ├── sink_handler.go ├── snapshot.go ├── snapshot_test.go ├── sort.go ├── sort_test.go ├── stringfilter.go ├── task.go ├── tokens.go ├── trigram.go ├── upgrade_test.go ├── worker.go ├── worker_test.go ├── zero.go └── zero_proxy.go ├── x ├── acl_enc_keys.go ├── config.go ├── debug.go ├── disk_metrics_linux.go ├── disk_metrics_others.go ├── doc.go ├── error.go ├── error_test.go ├── file.go ├── file_test.go ├── flags.go ├── health.go ├── histogram.go ├── init.go ├── jwt_helper.go ├── keys.go ├── keys_test.go ├── lock.go ├── log.go ├── log_writer.go ├── log_writer_test.go ├── logger.go ├── metrics.go ├── minioclient.go ├── names-generator.go ├── nodebug.go ├── profile.go ├── server.go ├── subcommand.go ├── tls_helper.go ├── types.go ├── ulimit_unix.go ├── ulimit_windows.go ├── values.go ├── values_test.go ├── vault.go ├── x.go └── x_test.go └── xidmap ├── trie.go ├── trie_test.go ├── xidmap.go └── xidmap_test.go /.dockerignore: -------------------------------------------------------------------------------- 1 | wiki 2 | .github 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # CODEOWNERS info: https://help.github.com/en/articles/about-code-owners 2 | # Owners are automatically requested for review for PRs that changes code 3 | # that they own. 4 | * @hypermodeinc/database -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: bug 6 | assignees: "" 7 | --- 8 | 9 | ## Describe the bug 10 | 11 | A clear and concise description of what the bug is. 12 | 13 | ## To Reproduce 14 | 15 | Steps to reproduce the behavior: 16 | 17 | 1. Go to '...' 18 | 2. Click on '....' 19 | 3. Scroll down to '....' 20 | 4. See error 21 | 22 | ## Expected behavior 23 | 24 | A clear and concise description of what you expected to happen. 25 | 26 | ## Screenshots 27 | 28 | If applicable, add screenshots to help explain your problem. 29 | 30 | ## Environment 31 | 32 | - OS: [e.g. macOS, Windows, Ubuntu] 33 | - Language [e.g. AssemblyScript, Go] 34 | - Version [e.g. v0.xx] 35 | 36 | ## Additional context 37 | 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Dgraph Community Support 4 | url: https://discord.hypermode.com 5 | about: Please ask and answer questions here 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | ## Is your feature request related to a problem? Please describe 10 | 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | ## Describe the solution you'd like 14 | 15 | A clear and concise description of what you want to happen. 16 | 17 | ## Describe alternatives you've considered 18 | 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | ## Additional context 22 | 23 | Add any other context or screenshots about the feature request here. 24 | -------------------------------------------------------------------------------- /.github/actionlint.yml: -------------------------------------------------------------------------------- 1 | self-hosted-runner: 2 | # Labels of self-hosted runner in array of string 3 | labels: 4 | - warp-ubuntu-latest-arm64-4x 5 | - warp-ubuntu-latest-x64-4x 6 | - warp-ubuntu-latest-arm64-16x 7 | - warp-ubuntu-latest-x64-16x 8 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["github>hypermodeinc/renovate-config"], 4 | "rangeStrategy": "widen", 5 | "ignorePaths": ["contrib/**"], 6 | "baseBranches": ["main", "release/v24.1"], 7 | "packageRules": [ 8 | { 9 | "matchBaseBranches": ["release/v24.1"], 10 | "groupName": "v24.1 patch", 11 | "matchUpdateTypes": ["digest", "patch"], 12 | "minimumReleaseAge": "3 days" 13 | }, 14 | { 15 | "matchBaseBranches": ["release/v24.1"], 16 | "matchUpdateTypes": ["minor", "major"], 17 | "enabled": false 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/cd-dgraph-nightly.yml: -------------------------------------------------------------------------------- 1 | name: Push Docker Image 2 | 3 | on: 4 | schedule: 5 | - cron: 0 0 * * * 6 | 7 | permissions: 8 | contents: read 9 | packages: write 10 | 11 | jobs: 12 | build: 13 | runs-on: warp-ubuntu-latest-x64-4x 14 | steps: 15 | - uses: docker/setup-buildx-action@v3.10.0 16 | 17 | - name: Log in to GitHub Container Registry 18 | uses: docker/login-action@v3.4.0 19 | with: 20 | registry: ghcr.io 21 | username: ${{ github.actor }} 22 | password: ${{ secrets.GITHUB_TOKEN }} 23 | 24 | - name: Build and push Docker image 25 | uses: docker/build-push-action@v6.17.0 26 | with: 27 | push: true 28 | platforms: linux/amd64,linux/arm64 29 | tags: ghcr.io/hypermodeinc/dgraph-standalone:nightly 30 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: labeler 2 | 3 | on: 4 | pull_request: 5 | types: 6 | - opened 7 | - reopened 8 | - synchronize 9 | - ready_for_review 10 | branches: 11 | - main 12 | - release/** 13 | 14 | permissions: 15 | contents: read 16 | pull-requests: write 17 | 18 | jobs: 19 | label: 20 | permissions: 21 | contents: read 22 | pull-requests: write 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v4 26 | - uses: actions/labeler@v5 27 | -------------------------------------------------------------------------------- /.github/workflows/trunk.yml: -------------------------------------------------------------------------------- 1 | name: Trunk Code Quality 2 | on: 3 | pull_request: 4 | branches: main 5 | 6 | permissions: 7 | contents: read 8 | actions: write 9 | checks: write 10 | 11 | jobs: 12 | trunk-code-quality: 13 | name: Trunk Code Quality 14 | uses: hypermodeinc/.github/.github/workflows/trunk.yml@main 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /installs 3 | /coverage.out 4 | /dgraph-bulk-loader 5 | /osx-docker-gopath 6 | 7 | # goland project folder 8 | .idea 9 | dgraph.iml 10 | 11 | # Binaries for programs and plugins 12 | *.exe 13 | *.exe~ 14 | *.dll 15 | *.so 16 | *.dylib 17 | 18 | # Test binary, build with `go test -c` 19 | *.test 20 | 21 | # Output of the go coverage tool 22 | *.out 23 | 24 | #darwin 25 | .DS_Store 26 | 27 | vendor 28 | .minio.sys 29 | 30 | # Local test files 31 | contrib/local-test/dql-data.json 32 | contrib/local-test/dql-data.rdf 33 | contrib/local-test/gql-data.json 34 | contrib/local-test/query.dql 35 | contrib/local-test/query.gql 36 | contrib/local-test/schema.dql 37 | contrib/local-test/schema.graphql 38 | contrib/local-test/variables.json 39 | 40 | 41 | # Dgraph 42 | systest/bulk_live/bulk/**/*.txt 43 | systest/bulk_live/bulk/**/*.rdf 44 | 45 | systest/bulk_live/live/**/*.rdf 46 | systest/bulk_live/live/**/*.txt 47 | x/log_test/*.enc 48 | *.buf 49 | -------------------------------------------------------------------------------- /.trunk/.gitignore: -------------------------------------------------------------------------------- 1 | *out 2 | *logs 3 | *actions 4 | *notifications 5 | *tools 6 | plugins 7 | user_trunk.yaml 8 | user.yaml 9 | tmp 10 | -------------------------------------------------------------------------------- /.trunk/configs/.checkov.yaml: -------------------------------------------------------------------------------- 1 | skip-check: 2 | - CKV_GHA_7 3 | - CKV_DOCKER_2 4 | -------------------------------------------------------------------------------- /.trunk/configs/.golangci.json: -------------------------------------------------------------------------------- 1 | { 2 | "formatters": { 3 | "exclusions": { 4 | "generated": "lax", 5 | "paths": ["third_party$", "builtin$", "examples$"] 6 | } 7 | }, 8 | "linters": { 9 | "exclusions": { 10 | "generated": "lax", 11 | "paths": ["third_party$", "builtin$", "examples$"], 12 | "presets": ["comments", "common-false-positives", "legacy", "std-error-handling"] 13 | } 14 | }, 15 | "run": { 16 | "build-tags": ["integration", "integration2", "upgrade"] 17 | }, 18 | "version": "2" 19 | } 20 | -------------------------------------------------------------------------------- /.trunk/configs/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | # Following source doesn't work in most setups 2 | ignored: 3 | - SC1090 4 | - SC1091 5 | -------------------------------------------------------------------------------- /.trunk/configs/.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "line-length": { "line_length": 150, "tables": false }, 3 | "no-inline-html": false, 4 | "no-bare-urls": false, 5 | "no-space-in-emphasis": false, 6 | "no-emphasis-as-heading": false, 7 | "first-line-heading": false 8 | } 9 | -------------------------------------------------------------------------------- /.trunk/configs/.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore all HTML files: 2 | **/*.graphql -------------------------------------------------------------------------------- /.trunk/configs/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "proseWrap": "always", 4 | "printWidth": 100 5 | } 6 | -------------------------------------------------------------------------------- /.trunk/configs/.shellcheckrc: -------------------------------------------------------------------------------- 1 | enable=all 2 | source-path=SCRIPTDIR 3 | disable=SC2154 4 | 5 | # If you're having issues with shellcheck following source, disable the errors via: 6 | # disable=SC1090 7 | # disable=SC1091 8 | -------------------------------------------------------------------------------- /.trunk/configs/.trivyignore.yaml: -------------------------------------------------------------------------------- 1 | misconfigurations: 2 | - id: AVD-DS-0026 3 | -------------------------------------------------------------------------------- /.trunk/configs/.yamllint.yaml: -------------------------------------------------------------------------------- 1 | rules: 2 | quoted-strings: 3 | required: only-when-needed 4 | extra-allowed: ["{|}"] 5 | key-duplicates: {} 6 | octal-values: 7 | forbid-implicit-octal: true 8 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["trunk.io"] 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "editor.defaultFormatter": "trunk.io", 4 | "editor.trimAutoWhitespace": true, 5 | "trunk.autoInit": false 6 | } 7 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting Security Concerns 2 | 3 | We take the security of Dgraph very seriously. If you believe you have found a security 4 | vulnerability in Dgraph, we encourage you to let us know right away. 5 | 6 | We will investigate all legitimate reports and do our best to quickly fix the problem. Please report 7 | any issues or vulnerabilities via GitHub Security Advisories instead of posting a public issue in 8 | GitHub. You can also send security communications to security@hypermode.com. 9 | 10 | Please include the version identifier and details on how the vulnerability can be exploited. 11 | -------------------------------------------------------------------------------- /acl/hmac-secret: -------------------------------------------------------------------------------- 1 | 1234567890123456789012345678901 2 | -------------------------------------------------------------------------------- /acl/integration_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package acl 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/stretchr/testify/suite" 14 | 15 | "github.com/hypermodeinc/dgraph/v25/dgraphapi" 16 | "github.com/hypermodeinc/dgraph/v25/dgraphtest" 17 | ) 18 | 19 | type AclTestSuite struct { 20 | suite.Suite 21 | dc dgraphapi.Cluster 22 | } 23 | 24 | func (suite *AclTestSuite) SetupTest() { 25 | suite.dc = dgraphtest.NewComposeCluster() 26 | } 27 | 28 | func (suite *AclTestSuite) Upgrade() { 29 | // not implemented for integration tests 30 | } 31 | 32 | func TestACLSuite(t *testing.T) { 33 | suite.Run(t, new(AclTestSuite)) 34 | } 35 | -------------------------------------------------------------------------------- /algo/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | // Package algo contains algorithms such as merging, intersecting sorted lists. 7 | package algo 8 | -------------------------------------------------------------------------------- /audit/testfiles/zero_audit_0_1.log.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/audit/testfiles/zero_audit_0_1.log.enc -------------------------------------------------------------------------------- /codec/benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | /benchmark 2 | -------------------------------------------------------------------------------- /codec/benchmark/clustered1M.bin.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/codec/benchmark/clustered1M.bin.gz -------------------------------------------------------------------------------- /compose/.gitignore: -------------------------------------------------------------------------------- 1 | /compose 2 | *.yml 3 | *.yaml 4 | /acl-secret 5 | /enc-secret 6 | -------------------------------------------------------------------------------- /compose/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: © Hypermode Inc. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | BIN = compose 7 | BUILD_FLAGS ?= "-N -l" 8 | 9 | .PHONY: all 10 | all: install_dgraph $(BIN) 11 | 12 | .PHONY: install 13 | install: all 14 | 15 | .PHONY: install_dgraph 16 | install_dgraph: 17 | $(MAKE) -C ../dgraph install 18 | 19 | $(BIN): compose.go 20 | go build -gcflags=$(BUILD_FLAGS) -o $(BIN) 21 | 22 | .PHONY: clean 23 | clean: 24 | rm -f $(BIN) docker-compose*.yml 25 | -------------------------------------------------------------------------------- /compose/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s 3 | scrape_configs: 4 | - job_name: 'dgraph' 5 | scrape_interval: 15s 6 | metrics_path: '/debug/prometheus_metrics' 7 | static_configs: 8 | - targets: 9 | - 'alpha1:8180' 10 | - 'alpha2:8182' 11 | - 'alpha3:8183' 12 | - 'alpha4:8184' 13 | - 'alpha5:8185' 14 | - 'alpha6:8186' 15 | - 'zero1:6180' 16 | - 'zero2:6182' 17 | - 'zero3:6183' 18 | - job_name: 'node-exporter' 19 | scrape_interval: 15s 20 | metrics_path: '/metrics' 21 | static_configs: 22 | - targets: 23 | - 'node-exporter:9100' 24 | -------------------------------------------------------------------------------- /contrib/jepsen/.gitignore: -------------------------------------------------------------------------------- 1 | /jepsen -------------------------------------------------------------------------------- /contrib/jepsen/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-FileCopyrightText: © Hypermode Inc. 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | 6 | DIR="../../dgraph" 7 | 8 | .PHONY: install 9 | 10 | install: jepsen 11 | $(MAKE) -C $(DIR) install; 12 | 13 | jepsen: main.go 14 | go build -v . 15 | 16 | -------------------------------------------------------------------------------- /contrib/standalone/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DGRAPH_VERSION=latest 2 | FROM dgraph/dgraph:${DGRAPH_VERSION} 3 | LABEL MAINTAINER="Hypermode Inc. " 4 | 5 | # Ratel port 6 | # EXPOSE 8000 ## Ratel is not supported in the standalone image 7 | # REST API port 8 | EXPOSE 8080 9 | # gRPC API port 10 | EXPOSE 9080 11 | 12 | ADD run.sh /run.sh 13 | RUN chmod +x /run.sh 14 | CMD ["/run.sh"] 15 | -------------------------------------------------------------------------------- /contrib/standalone/Makefile: -------------------------------------------------------------------------------- 1 | # Build dgraph/standalone image 2 | # Usage: 3 | # 4 | # For latest tag: 5 | # Build, based on dgraph/dgraph:latest: 6 | # make 7 | # Push: 8 | # make push 9 | # 10 | # For $TAG tag, set DGRAPH_VERSION: 11 | # Build, based on dgraph/dgraph:latest: 12 | # make DGRAPH_VERSION=$TAG 13 | # Push: 14 | # make DGRAPH_VERSION=$TAG push 15 | # 16 | # Examples 17 | # Build and push latest: 18 | # make 19 | # make push 20 | # 21 | # Build and push main: 22 | # make DGRAPH_VERSION=main 23 | # make DGRAPH_VERSION=main push 24 | # 25 | .PHONY: all build 26 | 27 | export DGRAPH_VERSION ?= local 28 | 29 | all: build 30 | 31 | build: 32 | ./hooks/build 33 | -------------------------------------------------------------------------------- /contrib/standalone/hooks/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Used for Makefile or Docker Hub builds 3 | docker build -t dgraph/standalone:"${DGRAPH_VERSION}" --build-arg DGRAPH_VERSION="${DGRAPH_VERSION}" . 4 | -------------------------------------------------------------------------------- /contrib/standalone/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # fail if any error occurs 4 | set -e 5 | 6 | echo -e "\033[0;33m 7 | Warning: This standalone version is meant for quickstart purposes only. 8 | It is NOT RECOMMENDED for production environments.\033[0;0m" 9 | 10 | # For Dgraph versions v20.11 and older 11 | export DGRAPH_ALPHA_WHITELIST=0.0.0.0/0 12 | # For Dgraph versions v21.03 and newer 13 | export DGRAPH_ALPHA_SECURITY='whitelist=0.0.0.0/0' 14 | 15 | # TODO properly handle SIGTERM for all three processes. 16 | dgraph zero & 17 | dgraph alpha 18 | -------------------------------------------------------------------------------- /dgraph/.gitignore: -------------------------------------------------------------------------------- 1 | /dgraph 2 | /p 3 | /w 4 | /zw 5 | /tls 6 | /export 7 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/.gitignore: -------------------------------------------------------------------------------- 1 | /dgraph 2 | /export 3 | /backup 4 | /m/ 5 | /p/ 6 | /u/ 7 | /w/ 8 | /wz/ 9 | /cpu.prof 10 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/debug.yaml: -------------------------------------------------------------------------------- 1 | # Folder in which to store backups. 2 | export: export 3 | 4 | # Fraction of dirty posting lists to commit every few seconds. 5 | gentlecommit: 0.33 6 | 7 | # RAFT ID that this server will use to join RAFT groups. 8 | idx: 1 9 | 10 | # Groups to be served by this instance. 11 | groups: "0,1" 12 | 13 | # Port to run http server on. (default 8080) 14 | port: 8080 15 | 16 | # Port to run grpc server on. (default 9080) 17 | grpc_port: 9080 18 | 19 | # Port used by worker for internal communication. 20 | workerport: 12345 21 | 22 | # The ratio of queries to trace. 23 | trace: 1.0 24 | 25 | # Directory to store posting lists. 26 | p: p 27 | 28 | # Directory to store raft write-ahead logs. 29 | w: w 30 | 31 | # Debug mode for testing. 32 | debugmode: false 33 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/schema_scalar: -------------------------------------------------------------------------------- 1 | date:dateTime @index 2 | age: int @index 3 | health: float @index 4 | name: string @index 5 | loc: geo @index 6 | 7 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/testdata.nq: -------------------------------------------------------------------------------- 1 | . 2 | . 3 | "I'm your Uncle Bob!" . 4 | . 5 | . 6 | . 7 | . 8 | "Smart Dani" . 9 | . 10 | . 11 | "Mr. Cool greg" . 12 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/testrun/conf1.yaml: -------------------------------------------------------------------------------- 1 | # RAFT ID that this server will use to join RAFT groups. 2 | idx: 1 3 | 4 | # Port to run server on. (default 8080) 5 | port: 8080 6 | 7 | # Grpc port 8 | grpc_port: 9080 9 | 10 | # Directory to store posting lists. 11 | p: p1 12 | 13 | # Directory to store raft write-ahead logs. 14 | w: w1 15 | 16 | # Port used by worker for internal communication. 17 | workerport: 12345 18 | 19 | groups: 0,1 20 | 21 | nomutations: true 22 | 23 | group_conf: groups.conf 24 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/testrun/conf2.yaml: -------------------------------------------------------------------------------- 1 | # RAFT ID that this server will use to join RAFT groups. 2 | idx: 2 3 | 4 | # Port to run server on. (default 8080) 5 | port: 8082 6 | 7 | grpc_port: 9082 8 | 9 | # Directory to store posting lists. 10 | p: p2 11 | 12 | # Directory to store raft write-ahead logs. 13 | w: w2 14 | 15 | # Port used by worker for internal communication. 16 | workerport: 12346 17 | 18 | groups: 0,1 19 | 20 | nomutations: true 21 | 22 | group_conf: groups.conf 23 | 24 | peer: localhost:12345 25 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/testrun/conf3.yaml: -------------------------------------------------------------------------------- 1 | # RAFT ID that this server will use to join RAFT groups. 2 | idx: 3 3 | 4 | # Port to run server on. (default 8080) 5 | port: 8084 6 | 7 | grpc_port: 9084 8 | 9 | # Directory to store posting lists. 10 | p: p3 11 | 12 | # Directory to store raft write-ahead logs. 13 | w: w3 14 | 15 | # Port used by worker for internal communication. 16 | workerport: 12347 17 | 18 | groups: 0,1 19 | 20 | nomutations: true 21 | 22 | group_conf: groups.conf 23 | 24 | peer: localhost:12345 25 | -------------------------------------------------------------------------------- /dgraph/cmd/alpha/thoughts.md: -------------------------------------------------------------------------------- 1 | 1. Select v/s Range 2 | 3 | 2. sync.WaitGroup. 4 | 5 | func handle(..) { wg.Add(1) ... wg.Done() } 6 | 7 | func main() { wg := new(sync.WaitGroup) for i := 0; i < N; i++ { go handle(..) } wg.Wait() } 8 | 9 | The above wouldn't work, because goroutines don't necessarily get scheduled immediately. So, 10 | wg.Add(1) wouldn't get called, which means wg.Wait() wouldn't block, and the program would finish 11 | execution before goroutines had a chance to be run. 12 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/.gitignore: -------------------------------------------------------------------------------- 1 | /dgraph-bulk-loader 2 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/speed_tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.gz 2 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/split_gz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [[ $# != 2 ]]; then 6 | echo "Usage: $0 " 7 | exit 1 8 | fi 9 | 10 | inDir=$1 11 | outDir=$2 12 | 13 | rm -rf "${outDir}" 14 | mkdir "${outDir}" 15 | for inputFile in ${inDir}/*.rdf.gz; do 16 | echo Processing: "${inputFile}" 17 | base=$(basename "${inputFile}" | cut -f 1 -d '.') 18 | gunzip <"${inputFile}" | split --lines=10000000 - "${outDir}"/"${base}"$(echo _) 19 | done 20 | for chunkedFile in ${outDir}/*; do 21 | echo "Zipping: ${chunkedFile}" 22 | gzip -S .rdf.gz "${chunkedFile}" & 23 | done 24 | wait 25 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite01/query.json: -------------------------------------------------------------------------------- 1 | { 2 | all(func: allofterms(name, "Peter")) { 3 | name 4 | }, 5 | 6 | any(func: anyofterms(name, "Peter")) { 7 | name 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite01/rdfs.rdf: -------------------------------------------------------------------------------- 1 | _:peter "Peter" . 2 | _:pawan "Pawan" . 3 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite01/result.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "all": [ 4 | { "name": "Peter" } 5 | ], 6 | "any": [ 7 | { "name": "Peter" } 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite01/schema.txt: -------------------------------------------------------------------------------- 1 | name: string @index(term) . 2 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite02/rdfs.rdf: -------------------------------------------------------------------------------- 1 | _:alice _:bob . 2 | _:alice _:carol . 3 | _:alice . 4 | 5 | _:bob _:carol . 6 | 7 | _:carol _:bob . 8 | _:carol . 9 | 10 | _:erin _:bob . 11 | _:erin _:carol . 12 | 13 | _:frank _:carol . 14 | _:frank . 15 | _:frank _:erin . 16 | 17 | _:grace _:alice . 18 | _:grace _:bob . 19 | _:grace _:carol . 20 | _:grace . 21 | _:grace _:erin . 22 | _:grace _:frank . 23 | 24 | _:alice "Alice" . 25 | _:bob "Bob" . 26 | _:carol "Carol" . 27 | _:erin "Erin" . 28 | _:frank "Frank" . 29 | _:grace "Grace" . 30 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite02/schema.txt: -------------------------------------------------------------------------------- 1 | friend: [uid] @count @reverse . 2 | name: string @index(exact) . 3 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite03/query.json: -------------------------------------------------------------------------------- 1 | { 2 | cooks(func: anyofterms(occupation, "Cook")) { 3 | name 4 | } 5 | occupation_count(func: has(occupation)) { 6 | name 7 | count(occupation) 8 | } 9 | eggplant(func: anyofterms(name, "eggplant")) { 10 | name 11 | } 12 | alex(func: anyofterms(name@., "Alex")) { 13 | name 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite03/rdfs.rdf: -------------------------------------------------------------------------------- 1 | _:gr "Gordon Ramsay" . 2 | _:gr "Cook" . 3 | _:gr "TV Presenter" . 4 | 5 | _:ww "Walter White" . 6 | _:ww "Heisenberg" . 7 | _:ww "Cook" . 8 | _:ww "Teacher" . 9 | 10 | _:ep "eggplant" . 11 | _:ep "aubergine" . 12 | _:ep "aubergine"@fr . 13 | _:ep "brinjal"@af . 14 | 15 | _:alex "Alex"@en . 16 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite03/result.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "cooks": [ 4 | { "name": "Gordon Ramsay" }, 5 | { "name": ["Heisenberg", "Walter White"] } 6 | ], 7 | "occupation_count": [ 8 | { 9 | "name": "Gordon Ramsay", 10 | "count(occupation)": 2 11 | }, 12 | { 13 | "name": ["Walter White", "Heisenberg"], 14 | "count(occupation)": 2 15 | } 16 | ], 17 | "eggplant": [ 18 | { 19 | "name": [ 20 | "eggplant", 21 | "aubergine", 22 | "aubergine", 23 | "brinjal" 24 | ] 25 | } 26 | ], 27 | "alex": [ 28 | { "name": "Alex" } 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /dgraph/cmd/bulk/systest/suite03/schema.txt: -------------------------------------------------------------------------------- 1 | name: [string] @index(term) . 2 | occupation: [string] @index(term) @count . 3 | -------------------------------------------------------------------------------- /dgraph/cmd/increment/.gitignore: -------------------------------------------------------------------------------- 1 | /increment 2 | -------------------------------------------------------------------------------- /dgraph/cmd/live/.gitignore: -------------------------------------------------------------------------------- 1 | /dgraph-live-loader 2 | /c 3 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-json/family.schema: -------------------------------------------------------------------------------- 1 | type FamilyMember { 2 | name 3 | age 4 | role 5 | aka 6 | carries 7 | parent_to 8 | sibling_of 9 | } 10 | 11 | name:string @index(term) . 12 | age: int . 13 | role: string @index(term) @lang . 14 | aka: string @index(term) . 15 | carries: string @index(term) . 16 | parent_to: [uid] @reverse . 17 | sibling_of: [uid] @reverse . 18 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-json/family1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "uid":"_:h", 4 | "name":"Homer", 5 | "age":"38", 6 | "role":"father", 7 | "role|gender":"male", 8 | "role@es":"padre", 9 | "dgraph.type": "FamilyMember", 10 | "parent_to": [ 11 | { "uid":"_:b" }, 12 | { "uid":"_:l" }, 13 | { "uid":"_:m2" } 14 | ] 15 | }, 16 | { 17 | "uid":"_:m1", 18 | "name":"Marge", 19 | "age":"34", 20 | "role":"mother", 21 | "aka":"Midge", 22 | "dgraph.type": "FamilyMember", 23 | "parent_to": [ 24 | { "uid":"_:b" }, 25 | { "uid":"_:l" }, 26 | { "uid":"_:m2" } 27 | ] 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-json/family2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "uid":"_:b", 4 | "name":"Bart", 5 | "age":"10", 6 | "role":"son", 7 | "aka":"El Barto", 8 | "carries":"slingshot", 9 | "dgraph.type": "FamilyMember", 10 | "sibling_of": [ 11 | { "uid":"_:l" }, 12 | { "uid":"_:m2" } 13 | ] 14 | }, 15 | { 16 | "uid":"_:l", 17 | "name":"Lisa", 18 | "age":"8", 19 | "role":"daughter", 20 | "carries":"saxomophone", 21 | "dgraph.type": "FamilyMember", 22 | "sibling_of": [ 23 | { "uid":"_:b" }, 24 | { "uid":"_:m2" } 25 | ] 26 | }, 27 | { 28 | "uid":"_:m2", 29 | "name":"Maggie", 30 | "age":"1", 31 | "role":"daughter", 32 | "role|gender":"female", 33 | "role|generation":3, 34 | "role@es":"hija", 35 | "carries":"pacifier", 36 | "dgraph.type": "FamilyMember", 37 | "sibling_of": [ 38 | { "uid":"_:b" }, 39 | { "uid":"_:l" } 40 | ] 41 | } 42 | ] 43 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-json/family3.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "uid":"_:a", 4 | "name":"Abraham", 5 | "age":"83", 6 | "role":"father", 7 | "aka":"Grampa", 8 | "dgraph.type": "FamilyMember", 9 | "parent_to": [ 10 | { "uid":"_:h" } 11 | ] 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/correct1.rdf: -------------------------------------------------------------------------------- 1 | <0x100>

. 2 | <0x100> "edge" . 3 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/correct2.rdf: -------------------------------------------------------------------------------- 1 | <0x100>

. 2 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/errored1.rdf: -------------------------------------------------------------------------------- 1 |

"abc"^^> . 2 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/errored2.rdf: -------------------------------------------------------------------------------- 1 |

"abcd" 2 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/family.schema: -------------------------------------------------------------------------------- 1 | type FamilyMember { 2 | name 3 | age 4 | role 5 | aka 6 | carries 7 | parent_to 8 | sibling_of 9 | } 10 | 11 | name:string @index(term) . 12 | age: int . 13 | role: string @index(term) . 14 | aka: string @index(term) . 15 | carries: string @index(term) . 16 | parent_to: [uid] @reverse . 17 | sibling_of: [uid] @reverse . 18 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/xid.schema: -------------------------------------------------------------------------------- 1 | name: string . 2 | value: string . 3 | xid: string @index(hash) . 4 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/xid_a.rdf: -------------------------------------------------------------------------------- 1 | "name 1234" . 2 | -------------------------------------------------------------------------------- /dgraph/cmd/live/load-uids/xid_b.rdf: -------------------------------------------------------------------------------- 1 | "value 1234" . 2 | -------------------------------------------------------------------------------- /dgraph/cmd/version/run.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package version 7 | 8 | import ( 9 | "fmt" 10 | "os" 11 | 12 | "github.com/spf13/cobra" 13 | 14 | "github.com/hypermodeinc/dgraph/v25/x" 15 | ) 16 | 17 | // Version is the sub-command invoked when running "dgraph version". 18 | var Version x.SubCommand 19 | 20 | func init() { 21 | Version.Cmd = &cobra.Command{ 22 | Use: "version", 23 | Short: "Prints the dgraph version details", 24 | Long: "Version prints the dgraph version as reported by the build details.", 25 | Run: func(cmd *cobra.Command, args []string) { 26 | fmt.Print(x.BuildDetails()) 27 | os.Exit(0) 28 | }, 29 | Annotations: map[string]string{"group": "default"}, 30 | } 31 | Version.Cmd.SetHelpTemplate(x.NonRootTemplate) 32 | } 33 | -------------------------------------------------------------------------------- /dgraph/cmd/version/version_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package version 7 | 8 | import ( 9 | "os" 10 | "path/filepath" 11 | "testing" 12 | 13 | "github.com/stretchr/testify/require" 14 | 15 | "github.com/hypermodeinc/dgraph/v25/testutil" 16 | ) 17 | 18 | // Test `dgraph version` with an empty config file. 19 | func TestDgraphVersion(t *testing.T) { 20 | tmpPath := t.TempDir() 21 | configPath := filepath.Join(tmpPath, "config.yml") 22 | configFile, err := os.Create(configPath) 23 | require.NoError(t, err) 24 | defer configFile.Close() 25 | require.NoError(t, testutil.Exec(testutil.DgraphBinaryPath(), "version", "--config", configPath)) 26 | } 27 | -------------------------------------------------------------------------------- /dgraph/cmd/zero/.gitignore: -------------------------------------------------------------------------------- 1 | /dgraphzero 2 | /w/ 3 | -------------------------------------------------------------------------------- /dgraph/main_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package main 7 | 8 | import ( 9 | "testing" 10 | ) 11 | 12 | func TestSystem(t *testing.T) { 13 | main() 14 | } 15 | -------------------------------------------------------------------------------- /dgraph/minio.env: -------------------------------------------------------------------------------- 1 | MINIO_ACCESS_KEY=accesskey 2 | MINIO_SECRET_KEY=secretkey 3 | -------------------------------------------------------------------------------- /dgraphtest/.gitignore: -------------------------------------------------------------------------------- 1 | repo 2 | binaries 3 | data 4 | secrets 5 | datafiles 6 | -------------------------------------------------------------------------------- /dgraphtest/README.md: -------------------------------------------------------------------------------- 1 | ## Run Tests Against Dgraph Cloud 2 | 3 | ### Setup Env Variables 4 | 5 | 1. set `TEST_DGRAPH_CLOUD_CLUSTER_URL` to the URL that the dgo client should use 6 | 2. set `TEST_DGRAPH_CLOUD_CLUSTER_TOKEN` to one of API keys that you can generate on the `Settings` 7 | page on the cloud UI 8 | 3. `TEST_DGRAPH_CLOUD_ACL` to `false` if ACLs are disabled. By default, ACLs are assumed to be 9 | enabled. 10 | 11 | ### Schema Mode 12 | 13 | The tests require the `Schema Mode` to be set to `Flexible` from the `Settings` page on the cloud 14 | UI. 15 | 16 | ### Running Tests 17 | 18 | ```bash 19 | go test -tags=cloud ./... 20 | ``` 21 | -------------------------------------------------------------------------------- /dql/fuzz-data/corpus.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/dql/fuzz-data/corpus.tar.gz -------------------------------------------------------------------------------- /edgraph/config_mem.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || darwin) && cgo 2 | // +build linux darwin 3 | // +build cgo 4 | 5 | /* 6 | * SPDX-FileCopyrightText: © Hypermode Inc. 7 | * SPDX-License-Identifier: Apache-2.0 8 | */ 9 | 10 | // This file is compiled on linux and darwin when cgo is enabled. 11 | 12 | package edgraph 13 | 14 | import ( 15 | "github.com/hypermodeinc/dgraph/v25/worker" 16 | ) 17 | 18 | // #include 19 | import "C" 20 | 21 | func init() { 22 | bytes := int64(C.sysconf(C._SC_PHYS_PAGES) * C.sysconf(C._SC_PAGE_SIZE)) 23 | worker.AvailableMemory = bytes / 1024 / 1024 24 | } 25 | -------------------------------------------------------------------------------- /enc/test-fixtures/bad-length-enc-key: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /enc/test-fixtures/dgraph.hcl: -------------------------------------------------------------------------------- 1 | path "secret/dgraph" { 2 | capabilities = ["read", "list"] 3 | } 4 | path "secret/data/dgraph" { 5 | capabilities = ["read", "list"] 6 | } 7 | -------------------------------------------------------------------------------- /enc/test-fixtures/dummy_role_id_file: -------------------------------------------------------------------------------- 1 | dummyRoleIDFile -------------------------------------------------------------------------------- /enc/test-fixtures/dummy_secret_id_file: -------------------------------------------------------------------------------- 1 | dummySecretIDFile -------------------------------------------------------------------------------- /enc/test-fixtures/enc-key: -------------------------------------------------------------------------------- 1 | 1234567890123456 -------------------------------------------------------------------------------- /filestore/local_files.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package filestore 7 | 8 | import ( 9 | "bufio" 10 | "io" 11 | "os" 12 | 13 | "github.com/hypermodeinc/dgraph/v25/chunker" 14 | "github.com/hypermodeinc/dgraph/v25/x" 15 | ) 16 | 17 | type localFiles struct { 18 | } 19 | 20 | func (*localFiles) Open(path string) (io.ReadCloser, error) { 21 | return os.Open(path) 22 | } 23 | 24 | func (*localFiles) Exists(path string) bool { 25 | if _, err := os.Stat(path); err != nil && os.IsNotExist(err) { 26 | return false 27 | } 28 | return true 29 | } 30 | 31 | func (*localFiles) FindDataFiles(str string, ext []string) []string { 32 | return x.FindDataFiles(str, ext) 33 | } 34 | 35 | func (*localFiles) ChunkReader(file string, key x.Sensitive) (*bufio.Reader, func()) { 36 | return chunker.FileReader(file, key) 37 | } 38 | 39 | var _ FileStore = (*localFiles)(nil) 40 | -------------------------------------------------------------------------------- /graphql/admin/shutdown.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package admin 7 | 8 | import ( 9 | "context" 10 | 11 | "github.com/golang/glog" 12 | 13 | "github.com/hypermodeinc/dgraph/v25/graphql/resolve" 14 | "github.com/hypermodeinc/dgraph/v25/graphql/schema" 15 | "github.com/hypermodeinc/dgraph/v25/x" 16 | ) 17 | 18 | func resolveShutdown(ctx context.Context, m schema.Mutation) (*resolve.Resolved, bool) { 19 | glog.Info("Got shutdown request through GraphQL admin API") 20 | 21 | x.ServerCloser.Signal() 22 | 23 | return resolve.DataResult( 24 | m, 25 | map[string]interface{}{m.Name(): response("Success", "Server is shutting down")}, 26 | nil, 27 | ), true 28 | } 29 | -------------------------------------------------------------------------------- /graphql/e2e/auth/sample_public_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsDE5Vm+cI9CQXGyAzYcs 3 | pf9ZKTMCGh66tp1K/frf21XwwBMugwHHVVxMnm4HBDNQUudBWaYD9KdUy1LSPFdX 4 | 5SHJLQJ7O2inmrTevG2+9zLf10B35hdqt+FZ3zoz4aQBTODBLkt35Bi06FpjBsVY 5 | VpB6YqCcpkuq3jlD+JEzuRGcMfo6cMn1xF15KTrxyCeJdsSon+jL+KGOohHgkdRH 6 | Mqu6ADP7qAjQUXhcYjqr2133ZvRVYsLOQFmW8AZpGudrL0Gil1QMeW2NO8ScWznh 7 | 5UAJF474KiLfzsMNG6NbY6Puc/08VqRXr/A/NRPm4MjVvZ1Rfq4/Dh8wHPYbC0LF 8 | owIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /graphql/e2e/common/README.md: -------------------------------------------------------------------------------- 1 | This package contains test functions which are called by other packages. The intention of this 2 | package is to contain all the end to end tests which can be run with different configuration options 3 | like schema, encoding, http method etc. 4 | -------------------------------------------------------------------------------- /graphql/e2e/custom_logic/README.md: -------------------------------------------------------------------------------- 1 | The test file should be run after bringing up the docker containers via docker-compose. Since the 2 | tests rely on a mock server, which is implemented via cmd/main.go, run the following command. 3 | 4 | ```bash 5 | docker-compose up --build 6 | ``` 7 | 8 | This command would cause a force rebuild of the docker image for the mock server anytime a change is 9 | made to the cmd/main.go file. 10 | -------------------------------------------------------------------------------- /graphql/e2e/custom_logic/cmd/.gitignore: -------------------------------------------------------------------------------- 1 | cmd 2 | node_modules -------------------------------------------------------------------------------- /graphql/e2e/custom_logic/cmd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.24-alpine 2 | 3 | COPY . /go/src/cmd/ 4 | 5 | WORKDIR /go/src/cmd 6 | 7 | RUN go mod tidy 8 | 9 | RUN go build -o main main.go 10 | 11 | RUN apk update && apk add git && apk add nodejs && apk add npm 12 | 13 | RUN npm install 14 | 15 | CMD ./main 16 | -------------------------------------------------------------------------------- /graphql/e2e/custom_logic/cmd/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hypermodeinc/dgraph/graphql/e2e/custom_logic/cmd 2 | 3 | go 1.24.3 4 | 5 | require ( 6 | github.com/graph-gophers/graphql-go v1.6.0 7 | gopkg.in/yaml.v3 v3.0.1 8 | ) 9 | -------------------------------------------------------------------------------- /graphql/e2e/custom_logic/cmd/index.js: -------------------------------------------------------------------------------- 1 | const graphql = require("graphql") 2 | 3 | // build internal graphql schema. 4 | const graphqlSchemaObj = graphql.buildSchema(process.argv[2]) 5 | 6 | // introspect and print the introspection result to stdout. 7 | graphql.graphql(graphqlSchemaObj, graphql.introspectionQuery).then((res) => { 8 | console.log(JSON.stringify(res)) 9 | }) 10 | -------------------------------------------------------------------------------- /graphql/e2e/custom_logic/cmd/package.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "name": "cmd", 4 | "version": "1.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "graphql-to-json-schema": "^1.0.0" 14 | } 15 | } -------------------------------------------------------------------------------- /graphql/resolve/auth_closed_by_default_query_test.yaml: -------------------------------------------------------------------------------- 1 | - name: Query with missing jwt token - type with auth directive 2 | gqlquery: | 3 | query { 4 | queryTodo { 5 | id 6 | owner 7 | text 8 | } 9 | } 10 | error: { "message": a valid JWT is required but was not provided } 11 | 12 | - name: Query with missing jwt token - type without auth directive 13 | gqlquery: | 14 | query { 15 | queryTodo { 16 | id 17 | owner 18 | text 19 | } 20 | } 21 | error: { "message": a valid JWT is required but was not provided } 22 | -------------------------------------------------------------------------------- /graphql/schema/testdata/apolloservice/input/custom-directive.graphql: -------------------------------------------------------------------------------- 1 | type User @remote { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | type Car @key(fields: "id"){ 7 | id: ID! 8 | name: String! 9 | } 10 | 11 | type Query { 12 | getMyFavoriteUsers(id: ID!): [User] @custom(http: { 13 | url: "http://my-api.com", 14 | method: "GET" 15 | }) 16 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/apolloservice/input/extended-types.graphql: -------------------------------------------------------------------------------- 1 | type Mission @key(fields: "id") { 2 | id: ID! 3 | crew: [Astronaut] @provides(fields: "name age") 4 | designation: String! 5 | startDate: String 6 | endDate: String 7 | } 8 | 9 | type Astronaut @key(fields: "id") @extends { 10 | id: ID! @external 11 | name: String @external 12 | age: Int @external 13 | missions: [Mission] 14 | } 15 | 16 | extend type Product @key(fields: "upc") { 17 | upc: String! @id @external 18 | price: Int @external 19 | weight: Int @external 20 | inStock: Boolean 21 | shippingEstimate: Float @requires(fields: "price weight") 22 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/apolloservice/input/generate-directive.graphql: -------------------------------------------------------------------------------- 1 | interface Character @secret(field: "password") @generate( 2 | query: { 3 | get: false, 4 | password: false 5 | }, 6 | subscription: false 7 | ) { 8 | id: ID! 9 | name: String! @search(by: [exact]) 10 | friends: [Character] 11 | } 12 | 13 | type Human implements Character @generate( 14 | query: { 15 | aggregate: true 16 | }, 17 | subscription: true 18 | ) { 19 | totalCredits: Int 20 | } 21 | 22 | type Person @withSubscription @generate( 23 | query: { 24 | get: false, 25 | query: true, 26 | password: true, 27 | aggregate: false 28 | }, 29 | mutation: { 30 | add: false, 31 | delete: false 32 | }, 33 | subscription: false 34 | ) { 35 | id: ID! 36 | name: String! 37 | } 38 | -------------------------------------------------------------------------------- /graphql/schema/testdata/apolloservice/input/single-extended-type.graphql: -------------------------------------------------------------------------------- 1 | extend type Product @key(fields: "id") { 2 | id: String! @id @external 3 | name: String! 4 | } 5 | -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/enum_withdeprecated.txt: -------------------------------------------------------------------------------- 1 | { 2 | __type(name: "TestDeprecatedEnum") { 3 | name 4 | enumValues(includeDeprecated: true) { 5 | name 6 | isDeprecated 7 | deprecationReason 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/enum_withoutdeprecated.txt: -------------------------------------------------------------------------------- 1 | { 2 | __type(name: "TestDeprecatedEnum") { 3 | name 4 | enumValues(includeDeprecated: false) { 5 | name 6 | isDeprecated 7 | deprecationReason 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/type_complex_object_name_filter.txt: -------------------------------------------------------------------------------- 1 | { 2 | __type(name: "TestInputObject") { 3 | kind 4 | name 5 | inputFields { 6 | name 7 | type { ...TypeRef } 8 | defaultValue 9 | } 10 | } 11 | } 12 | 13 | fragment TypeRef on __Type { 14 | kind 15 | name 16 | ofType { 17 | kind 18 | name 19 | ofType { 20 | kind 21 | name 22 | ofType { 23 | kind 24 | name 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/type_filter.txt: -------------------------------------------------------------------------------- 1 | { 2 | typeKindType: __type(name: "__TypeKind") { 3 | name, 4 | enumValues { 5 | name, 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/type_object_name_filter.txt: -------------------------------------------------------------------------------- 1 | { 2 | __type(name: "QueryRoot") { 3 | name 4 | } 5 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/type_schema_filter.txt: -------------------------------------------------------------------------------- 1 | { 2 | schemaType: __type(name: "__Schema") { 3 | name, 4 | fields { 5 | name, 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/type_withdeprecated.txt: -------------------------------------------------------------------------------- 1 | { 2 | __type(name: "TestDeprecatedObject") { 3 | name 4 | fields(includeDeprecated: true) { 5 | name 6 | isDeprecated 7 | deprecationReason 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/input/type_withoutdeprecated.txt: -------------------------------------------------------------------------------- 1 | { 2 | __type(name: "TestDeprecatedObject") { 3 | name 4 | fields(includeDeprecated: false) { 5 | name 6 | isDeprecated 7 | deprecationReason 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/enum_withdeprecated.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type": { 3 | "name": "TestDeprecatedEnum", 4 | "enumValues": [ 5 | { 6 | "deprecationReason": null, 7 | "isDeprecated": true, 8 | "name": "dep" 9 | }, 10 | { 11 | "deprecationReason": null, 12 | "isDeprecated": false, 13 | "name": "notDep" 14 | }, 15 | { 16 | "deprecationReason": "because", 17 | "isDeprecated": true, 18 | "name": "depReason" 19 | } 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/enum_withoutdeprecated.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type": { 3 | "name": "TestDeprecatedEnum", 4 | "enumValues": [ 5 | { 6 | "deprecationReason": null, 7 | "isDeprecated": false, 8 | "name": "notDep" 9 | } 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/type_complex_object_name_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type": { 3 | "kind": "INPUT_OBJECT", 4 | "name": "TestInputObject", 5 | "inputFields": [ 6 | { 7 | "name": "a", 8 | "type": { 9 | "kind": "SCALAR", 10 | "name": "String", 11 | "ofType": null 12 | }, 13 | "defaultValue": "test" 14 | }, 15 | { 16 | "name": "b", 17 | "type": { 18 | "kind": "LIST", 19 | "name": null, 20 | "ofType": { 21 | "kind": "SCALAR", 22 | "name": "String", 23 | "ofType": null 24 | } 25 | }, 26 | "defaultValue": null 27 | }, 28 | { 29 | "name": "c", 30 | "type": { 31 | "kind": "SCALAR", 32 | "name": "String", 33 | "ofType": null 34 | }, 35 | "defaultValue": "null" 36 | } 37 | ] 38 | } 39 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/type_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "typeKindType": { 3 | "name": "__TypeKind", 4 | "enumValues": [ 5 | { 6 | "name": "SCALAR" 7 | }, 8 | { 9 | "name": "OBJECT" 10 | }, 11 | { 12 | "name": "INTERFACE" 13 | }, 14 | { 15 | "name": "UNION" 16 | }, 17 | { 18 | "name": "ENUM" 19 | }, 20 | { 21 | "name": "INPUT_OBJECT" 22 | }, 23 | { 24 | "name": "LIST" 25 | }, 26 | { 27 | "name": "NON_NULL" 28 | } 29 | ] 30 | } 31 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/type_object_name_filter.json: -------------------------------------------------------------------------------- 1 | {"__type":{"name":"QueryRoot"}} -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/type_schema_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaType": { 3 | "fields": [ 4 | { 5 | "name": "types" 6 | }, 7 | { 8 | "name": "queryType" 9 | }, 10 | { 11 | "name": "mutationType" 12 | }, 13 | { 14 | "name": "subscriptionType" 15 | }, 16 | { 17 | "name": "directives" 18 | } 19 | ], 20 | "name": "__Schema" 21 | } 22 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/type_withdeprecated.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type": { 3 | "name": "TestDeprecatedObject", 4 | "fields": [ 5 | { 6 | "deprecationReason": null, 7 | "isDeprecated": true, 8 | "name": "dep" 9 | }, 10 | { 11 | "deprecationReason": null, 12 | "isDeprecated": false, 13 | "name": "notDep" 14 | }, 15 | { 16 | "deprecationReason": "because", 17 | "isDeprecated": true, 18 | "name": "depReason" 19 | } 20 | ] 21 | } 22 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/introspection/output/type_withoutdeprecated.json: -------------------------------------------------------------------------------- 1 | { 2 | "__type": { 3 | "name": "TestDeprecatedObject", 4 | "fields": [ 5 | { 6 | "deprecationReason": null, 7 | "isDeprecated": false, 8 | "name": "notDep" 9 | } 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/apollo-federation.graphql: -------------------------------------------------------------------------------- 1 | extend type Product @key(fields: "id") { 2 | id: ID! @external 3 | name: String! @external 4 | price: Int @external 5 | weight: Int @external 6 | reviews: [Reviews] @requires(fields: "price weight") 7 | } 8 | 9 | type Reviews @key(fields: "id") { 10 | id: ID! 11 | review: String! 12 | user: User @provides(fields: "age") 13 | } 14 | 15 | type Student @key(fields: "id"){ 16 | id: ID! 17 | name: String! 18 | age: Int! 19 | } 20 | 21 | type School @key(fields: "id"){ 22 | id: ID! 23 | students: [Student] @provides(fields: "name") 24 | } 25 | 26 | extend type User @key(fields: "name") { 27 | id: ID! @external 28 | name: String! @id @external 29 | age: Int! @external 30 | reviews: [Reviews] 31 | } 32 | 33 | type Country { 34 | code: String! @id 35 | name: String! 36 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/auth-on-interfaces.graphql: -------------------------------------------------------------------------------- 1 | type Author { 2 | id: ID! 3 | name: String! @search(by: [hash]) 4 | posts: [Post] @hasInverse(field: author) 5 | } 6 | 7 | interface Post @secret(field: "pwd") @auth( 8 | password: { rule: "{$ROLE: { eq: \"Admin\" } }"}, 9 | query: { rule: """ 10 | query($TEXT: String!) { 11 | queryPost(filter: { text : {eq: $TEXT } } ) { 12 | id 13 | } 14 | }""" } 15 | ){ 16 | id: ID! 17 | text: String @search(by: [exact]) 18 | datePublished: DateTime @search 19 | author: Author! 20 | } 21 | 22 | type Question implements Post @auth( 23 | query: { rule: """ 24 | query($ANS: Boolean!) { 25 | queryQuestion(filter: { answered: $ANS } ) { 26 | id 27 | } 28 | }""" } 29 | ){ 30 | answered: Boolean @search 31 | } 32 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/comments-and-descriptions.graphql: -------------------------------------------------------------------------------- 1 | # comment - see also e2e schema 2 | 3 | """ 4 | Desc 5 | """ 6 | interface I { 7 | """ 8 | Desc 9 | """ 10 | s: String! 11 | } 12 | 13 | """ 14 | Desc 15 | """ 16 | type T implements I { 17 | # # comment 18 | id: ID! # comment 19 | 20 | """ 21 | Desc 22 | """ 23 | i: Int 24 | } 25 | 26 | # comment 27 | 28 | """ 29 | Desc 30 | """ 31 | enum AnEnum { 32 | AVal 33 | 34 | """ 35 | Desc 36 | """ 37 | AnotherVal 38 | } 39 | 40 | """ 41 | Desc 42 | """ 43 | union A_Union = T 44 | 45 | """ 46 | Desc 47 | """ 48 | input AnInput { 49 | # # comment 50 | id: ID! # comment 51 | 52 | """ 53 | Desc 54 | """ 55 | i: Int 56 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/created-updated-directives.graphql: -------------------------------------------------------------------------------- 1 | type Booking { 2 | id: ID! 3 | name: String! 4 | created: DateTime! @default(add: {value:"$now"}) 5 | updated: DateTime! @default(add: {value:"$now"}, update: {value:"$now"}) 6 | } 7 | 8 | type BookingXID { 9 | id: String! @id 10 | name: String! 11 | created: DateTime! @default(add: {value:"$now"}) 12 | updated: DateTime! @default(add: {value:"$now"}, update: {value:"$now"}) 13 | } 14 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/custom-dql-query-with-subscription.graphql: -------------------------------------------------------------------------------- 1 | type Tweets { 2 | id: ID! 3 | text: String! @search(by: [fulltext]) 4 | author: User 5 | timestamp: DateTime! @search 6 | } 7 | type User { 8 | screenName: String! @id 9 | followers: Int @search 10 | tweets: [Tweets] @hasInverse(field: author) 11 | } 12 | type UserTweetCount @remote { 13 | screenName: String 14 | tweetCount: Int 15 | } 16 | 17 | type Query { 18 | queryUserTweetCounts : [UserTweetCount] @withSubscription @custom(dql: """ 19 | query { 20 | queryUserTweetCounts(func: type(User)) { 21 | screenName: User.screenName 22 | tweetCount: count(User.tweets) 23 | } 24 | } 25 | """) 26 | } 27 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/custom-mutation.graphql: -------------------------------------------------------------------------------- 1 | type User { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | input UpdateFavouriteUserInput { 7 | name: String! 8 | } 9 | 10 | type Mutation { 11 | createMyFavouriteUsers(input: [UpdateFavouriteUserInput!]!): [User] @custom(http: { 12 | url: "http://my-api.com", 13 | method: "POST", 14 | body: "{ data: $input }" 15 | }) 16 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/custom-nested-types.graphql: -------------------------------------------------------------------------------- 1 | type Car @remote { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | interface Person @remote { 7 | age: Int! 8 | } 9 | 10 | type User implements Person @remote { 11 | id: ID! 12 | name: String! 13 | cars: [Car] 14 | } 15 | 16 | input UserInput { 17 | name: String! 18 | age: Int! 19 | cars: [CarInput] 20 | } 21 | 22 | input CarInput { 23 | name: String! 24 | } 25 | 26 | type Query { 27 | getMyFavoriteUsers(id: ID!): [User] @custom(http: { 28 | url: "http://my-api.com", 29 | method: "GET" 30 | }) 31 | } 32 | 33 | type Mutation { 34 | createMyFavouriteUsers(input: [UserInput!]!): [User] @custom(http: { 35 | url: "http://my-api.com", 36 | method: "POST", 37 | body: "$input" 38 | }) 39 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/custom-query-mixed-types.graphql: -------------------------------------------------------------------------------- 1 | type User @remote { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | type Car { 7 | id: ID! 8 | name: String! 9 | } 10 | 11 | type Query { 12 | getMyFavoriteUsers(id: ID!): [User] @custom(http: { 13 | url: "http://my-api.com", 14 | method: "GET" 15 | }) 16 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/custom-query-not-dgraph-type.graphql: -------------------------------------------------------------------------------- 1 | type User @remote { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | input UserInput { 7 | name: String! 8 | } 9 | 10 | type Query { 11 | getMyFavoriteUsers(id: ID!): [User] @custom(http: { 12 | url: "http://my-api.com", 13 | method: "GET" 14 | }) 15 | } 16 | 17 | type Mutation { 18 | createMyFavouriteUsers(input: [UserInput!]!): [User] @custom(http: { 19 | url: "http://my-api.com", 20 | method: "POST", 21 | body: "{ data: $input }" 22 | }) 23 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/custom-query-with-dgraph-type.graphql: -------------------------------------------------------------------------------- 1 | type User { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | type Query { 7 | getMyFavoriteUsers(id: ID!): [User] @custom(http: { 8 | url: "http://my-api.com", 9 | method: "GET" 10 | }) 11 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/deprecated.graphql: -------------------------------------------------------------------------------- 1 | type Atype { 2 | iamDeprecated: String @deprecated 3 | soAmI: String! @deprecated(reason: "because") 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/dgraph-reverse-directive-on-concrete-type-with-interfaces.graphql: -------------------------------------------------------------------------------- 1 | interface Movie { 2 | id: ID! 3 | name: String! 4 | director: [Director] @dgraph(pred: "directed.movies") 5 | } 6 | 7 | type OscarMovie implements Movie { 8 | year: Int! 9 | } 10 | 11 | type Director { 12 | id: ID! 13 | name: String! 14 | directed: [OscarMovie] @dgraph(pred: "~directed.movies") 15 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/dgraph-reverse-directive-with-interfaces.graphql: -------------------------------------------------------------------------------- 1 | interface Movie { 2 | id: ID! 3 | name: String! 4 | director: [Director] @dgraph(pred: "~directed.movies") 5 | } 6 | 7 | type OscarMovie implements Movie { 8 | year: Int! 9 | } 10 | 11 | type Director { 12 | id: ID! 13 | name: String! 14 | directed: [OscarMovie] @dgraph(pred: "directed.movies") 15 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/embedding-directive-with-similar-queries.graphql: -------------------------------------------------------------------------------- 1 | # simple user product GraphQL API - v0.4 2 | 3 | type Product { 4 | id: String! @id 5 | description: String 6 | title: String 7 | imageUrl: String 8 | product_vector: [Float!] @embedding @search(by: ["hnsw(metric: euclidean, exponent: 4)"]) 9 | } 10 | 11 | type Purchase @lambdaOnMutate(add: true){ 12 | user: User @hasInverse(field: "purchase_history") 13 | product: Product 14 | date: DateTime @search(by: [day]) 15 | } 16 | 17 | type User { 18 | email: String! @id 19 | purchase_history: [Purchase] 20 | user_vector: [Float!] @embedding @search(by: ["hnsw"]) 21 | } 22 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/field-with-id-directive.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | postID: ID 3 | content: String! 4 | author: Author! 5 | genre: Genre 6 | } 7 | 8 | type Author { 9 | id: ID 10 | name: String! @id @search(by: [regexp]) 11 | pen_name: String 12 | posts: [Post] 13 | } 14 | 15 | type Genre { 16 | # This will add exact index on name field, overwriting the default "hash" index for field of type "String! @id". 17 | name: String! @id @search(by: [exact]) 18 | } 19 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/field-with-multiple-@id-fields.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | postID: ID 3 | content: String! 4 | author: Author! 5 | genre: Genre 6 | } 7 | 8 | type Author { 9 | id: ID 10 | name: String! @id @search(by: [regexp]) 11 | pen_name: String! @id 12 | posts: [Post] 13 | } 14 | 15 | type Genre { 16 | name: String! @id 17 | } 18 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/field-with-reverse-predicate-in-dgraph-directive.graphql: -------------------------------------------------------------------------------- 1 | type Movie { 2 | id: ID! 3 | name: String! 4 | director: [MovieDirector] @dgraph(pred: "~directed.movies") 5 | } 6 | 7 | type MovieDirector { 8 | id: ID! 9 | name: String! 10 | directed: [Movie] @dgraph(pred: "directed.movies") 11 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/filter-cleanSchema-all-empty.graphql: -------------------------------------------------------------------------------- 1 | type X { 2 | name: [Y] 3 | f1: [Y] @dgraph(pred: "f1") 4 | } 5 | 6 | type Y { 7 | f1: [X] @dgraph(pred: "~f1") 8 | } 9 | 10 | type Z { 11 | add:[X] 12 | } 13 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/filter-cleanSchema-circular.graphql: -------------------------------------------------------------------------------- 1 | type X{ 2 | f1: [Y] @dgraph(pred: "f1") 3 | f3: [Z] @dgraph(pred: "~f3") 4 | } 5 | 6 | type Y{ 7 | f1: [X] @dgraph(pred: "~f1") 8 | f2: [Z] @dgraph(pred: "f2") 9 | } 10 | 11 | type Z{ 12 | f2: [Y] @dgraph(pred: "~f2") 13 | f3: [X] @dgraph(pred: "f3") 14 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/filter-cleanSchema-custom-mutation.graphql: -------------------------------------------------------------------------------- 1 | type User { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | input UserInput { 7 | name: String! 8 | } 9 | 10 | type Mutation { 11 | addMyFavouriteUsers(input: [UserInput!]!): [User] @custom(http: { 12 | url: "http://my-api.com", 13 | method: "POST", 14 | body: "{ data: $input }" 15 | }) 16 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/filter-cleanSchema-directLink.graphql: -------------------------------------------------------------------------------- 1 | type X { 2 | f1: [Y] @dgraph(pred: "f1") 3 | name: String 4 | id: ID 5 | } 6 | 7 | type Y { 8 | f2: [Z] @dgraph(pred: "~f2") 9 | f1: [X] @dgraph(pred: "~f1") 10 | } 11 | 12 | type Z { 13 | f2: [Y] @dgraph(pred: "f2") 14 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/generate-directive.graphql: -------------------------------------------------------------------------------- 1 | interface Character @secret(field: "password") @generate( 2 | query: { 3 | get: false, 4 | password: false 5 | }, 6 | subscription: false 7 | ) { 8 | id: ID! 9 | name: String! @search(by: [exact]) 10 | friends: [Character] 11 | } 12 | 13 | type Human implements Character @generate( 14 | query: { 15 | aggregate: true 16 | }, 17 | subscription: true 18 | ) { 19 | totalCredits: Int 20 | } 21 | 22 | type Person @withSubscription @generate( 23 | query: { 24 | get: false, 25 | query: true, 26 | password: true, 27 | aggregate: false 28 | }, 29 | mutation: { 30 | add: false, 31 | delete: false 32 | }, 33 | subscription: false 34 | ) { 35 | id: ID! 36 | name: String! 37 | } 38 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/geo-type.graphql: -------------------------------------------------------------------------------- 1 | type Hotel { 2 | id: ID! 3 | name: String! 4 | location: Point @search 5 | secretLocation: Point 6 | area: Polygon @search 7 | secretArea: Polygon 8 | branches: MultiPolygon @search 9 | secretBranches: MultiPolygon 10 | } 11 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/hasInverse-with-interface-having-directive.graphql: -------------------------------------------------------------------------------- 1 | type Author { 2 | id: ID! 3 | name: String! @search(by: [hash]) 4 | posts: [Post] 5 | } 6 | 7 | interface Post { 8 | id: ID! 9 | text: String @search(by: [fulltext]) 10 | datePublished: DateTime @search 11 | author: Author! @hasInverse(field: posts) 12 | } 13 | 14 | type Question implements Post { 15 | answered: Boolean 16 | } 17 | 18 | type Answer implements Post { 19 | markedUseful: Boolean 20 | } 21 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/hasInverse-with-interface.graphql: -------------------------------------------------------------------------------- 1 | type Author { 2 | id: ID! 3 | name: String! @search(by: [hash]) 4 | questions: [Question] @hasInverse(field: author) 5 | answers: [Answer] @hasInverse(field: author) 6 | } 7 | 8 | interface Post { 9 | id: ID! 10 | text: String @search(by: [fulltext]) 11 | datePublished: DateTime @search 12 | author: Author! 13 | } 14 | 15 | type Question implements Post { 16 | answered: Boolean 17 | } 18 | 19 | type Answer implements Post { 20 | markedUseful: Boolean 21 | } 22 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/hasInverse-with-type-having-directive.graphql: -------------------------------------------------------------------------------- 1 | type Author { 2 | id: ID! 3 | name: String! @search(by: [hash]) 4 | posts: [Post] @hasInverse(field: author) 5 | } 6 | 7 | interface Post { 8 | id: ID! 9 | text: String @search(by: [fulltext]) 10 | datePublished: DateTime @search 11 | author: Author! 12 | } 13 | 14 | type Question implements Post { 15 | answered: Boolean 16 | } 17 | 18 | type Answer implements Post { 19 | markedUseful: Boolean 20 | } 21 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/hasInverse.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | id: ID! 3 | author: Author! @hasInverse(field: "posts") 4 | } 5 | 6 | type Author { 7 | id: ID! 8 | posts: [Post!]! @hasInverse(field: "author") 9 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/hasInverse_withSubscription.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | id: ID! 3 | author: Author! @hasInverse(field: "posts") 4 | } 5 | 6 | type Author @withSubscription{ 7 | id: ID! 8 | posts: [Post!]! @hasInverse(field: "author") 9 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/hasfilter.graphql: -------------------------------------------------------------------------------- 1 | interface I { 2 | id: ID! 3 | } 4 | 5 | type T implements I { 6 | text: String 7 | } 8 | 9 | type B { 10 | name: String 11 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/ignore-unsupported-directive.graphql: -------------------------------------------------------------------------------- 1 | enum Role { 2 | Admin 3 | User 4 | } 5 | 6 | directive @unkown1(r: Role = User) on OBJECT | FIELD_DEFINITION 7 | directive @unkown2(r: Role = User, b: Role = User) on FIELD_DEFINITION 8 | directive @unkown3(r: Role = User, b: Role = User) on FIELD_DEFINITION 9 | 10 | type Product @unkown1 { 11 | id: ID! 12 | price: Float! @search @unkown1(r: Admin) @unkown2(r: User, b: Admin) 13 | name: String! @unkown1(r: Admin) @search @unkown2 @unkown3 @dgraph(pred: "p") 14 | name2: String! @unkown1(r: Admin) @search @unkown2 @dgraph(pred: "p") @unkown3 15 | } 16 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/interface-with-dgraph-pred.graphql: -------------------------------------------------------------------------------- 1 | type Object { 2 | id: ID! 3 | name: String 4 | ownedBy: Person @dgraph(pred: "Object.owner") 5 | } 6 | 7 | type BusinessMan implements Person { 8 | companyName: String 9 | } 10 | 11 | interface Person { 12 | id: ID! 13 | name: String 14 | owns: [Object] @dgraph(pred: "~Object.owner") 15 | } 16 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/interface-with-id-directive.graphql: -------------------------------------------------------------------------------- 1 | interface LibraryItem { 2 | refID: String! @id(interface:false) 3 | itemID: String! @id(interface:true) 4 | } 5 | 6 | type Book implements LibraryItem { 7 | title: String 8 | author: String 9 | } 10 | 11 | type Library { 12 | items: [LibraryItem] 13 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/interface-with-no-ids.graphql: -------------------------------------------------------------------------------- 1 | interface Message { 2 | text: String 3 | } 4 | 5 | type Question implements Message { 6 | askedBy: User 7 | } 8 | 9 | type User { 10 | name: String 11 | messages: [Message] 12 | } 13 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/interfaces-with-types-and-password.graphql: -------------------------------------------------------------------------------- 1 | interface Character @secret(field: "password") { 2 | id: ID! 3 | name: String! @search(by: [exact]) 4 | friends: [Character] 5 | appearsIn: [Episode!]! @search 6 | } 7 | 8 | type Human implements Character { 9 | starships: [Starship] 10 | totalCredits: Int 11 | } 12 | 13 | type Droid implements Character { 14 | primaryFunction: String 15 | } 16 | 17 | enum Episode { 18 | NEWHOPE 19 | EMPIRE 20 | JEDI 21 | } 22 | 23 | type Starship { 24 | id: ID! 25 | name: String! @search(by: [term]) 26 | length: Float 27 | } 28 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/interfaces-with-types.graphql: -------------------------------------------------------------------------------- 1 | interface Character { 2 | id: ID! 3 | name: String! @search(by: [exact]) 4 | friends: [Character] 5 | appearsIn: [Episode!]! @search 6 | } 7 | 8 | type Human implements Character { 9 | starships: [Starship] 10 | totalCredits: Int 11 | } 12 | 13 | type Droid implements Character { 14 | primaryFunction: String 15 | } 16 | 17 | enum Episode { 18 | NEWHOPE 19 | EMPIRE 20 | JEDI 21 | } 22 | 23 | type Starship { 24 | id: ID! 25 | name: String! @search(by: [term]) 26 | length: Float 27 | } 28 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/lambda-directive.graphql: -------------------------------------------------------------------------------- 1 | type User { 2 | id: ID! 3 | firstName: String! 4 | lastName: String! 5 | fullName: String @lambda 6 | } 7 | 8 | type Query { 9 | queryUserNames(id: [ID!]!): [String] @lambda 10 | } 11 | 12 | type Mutation { 13 | createUser(firstName: String!, lastName: String!): User @lambda 14 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/no-id-field-with-searchables.graphql: -------------------------------------------------------------------------------- 1 | # This should still generate and, or keys in PostFilter. 2 | type Post { 3 | content: String! @search 4 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/password-type.graphql: -------------------------------------------------------------------------------- 1 | type Author @secret(field: "pwd") { 2 | name: String! @id 3 | token: String 4 | } 5 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/searchables-references.graphql: -------------------------------------------------------------------------------- 1 | type Author { 2 | id: ID! 3 | name: String! @search(by: [hash]) 4 | dob: DateTime # Have something not search 5 | posts: [Post] # This should have arguments added for a filter on Post 6 | } 7 | 8 | type Post { 9 | postID: ID! 10 | title: String! @search(by: ["term", "fulltext"]) 11 | text: String @search(by: ["fulltext", "term"]) 12 | datePublished: DateTime # Have something not search 13 | } 14 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/single-type-with-enum.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | id: ID! 3 | title: String! 4 | text: String 5 | postType: PostType! 6 | } 7 | 8 | enum PostType { 9 | Statement 10 | Question 11 | Answer 12 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/single-type.graphql: -------------------------------------------------------------------------------- 1 | type Message { 2 | id: ID! 3 | content: String! 4 | author: String 5 | uniqueId: Int64 6 | datePosted: DateTime 7 | } 8 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/type-implements-multiple-interfaces.graphql: -------------------------------------------------------------------------------- 1 | interface Character { 2 | id: ID! 3 | name: String! @search(by: [exact]) 4 | friends: [Character] 5 | } 6 | 7 | interface Employee { 8 | employeeId: String! 9 | title: String! 10 | } 11 | 12 | type Human implements Character & Employee { 13 | totalCredits: Int 14 | } 15 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/type-reference.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | id: ID! 3 | title: String! 4 | text: String 5 | author: Author! 6 | } 7 | 8 | type Author { 9 | id: ID! 10 | name: String! 11 | } 12 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/type-with-arguments-on-field.graphql: -------------------------------------------------------------------------------- 1 | interface Abstract { 2 | id: ID! 3 | name(random: Int!, size: String): String! 4 | } 5 | 6 | type Message implements Abstract { 7 | content(pick: Int!, name: String): String! 8 | author: String 9 | datePosted: DateTime 10 | } 11 | -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/type-with-custom-field-on-dgraph-type.graphql: -------------------------------------------------------------------------------- 1 | type Car { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | type User { 7 | id: ID! 8 | name: String @custom(http: { 9 | url: "http://mock:8888/userNames", 10 | method: "GET", 11 | body: "{uid: $id}" 12 | }) 13 | age: Int! @search 14 | cars: [Car] @custom(http: { 15 | url: "http://mock:8888/cars", 16 | method: "GET", 17 | body: "{uid: $id}" 18 | }) 19 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/type-with-custom-fields-on-remote-type.graphql: -------------------------------------------------------------------------------- 1 | type Car @remote { 2 | id: ID! 3 | name: String! 4 | } 5 | 6 | type User { 7 | id: ID! 8 | name: String @custom(http: { 9 | url: "http://mock:8888/userNames", 10 | method: "GET", 11 | body: "{uid: $id}" 12 | }) 13 | age: Int! @search 14 | cars: [Car] @custom(http: { 15 | url: "http://mock:8888/cars", 16 | method: "GET", 17 | body: "{uid: $id}" 18 | }) 19 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/type-without-orderables.graphql: -------------------------------------------------------------------------------- 1 | type Data { 2 | id: ID! 3 | intList: [Int] 4 | stringList: [String] 5 | metaData: Data 6 | } -------------------------------------------------------------------------------- /graphql/schema/testdata/schemagen/input/union.graphql: -------------------------------------------------------------------------------- 1 | interface Character { 2 | id: ID! 3 | name: String! @search(by: [exact]) 4 | friends: [Character] 5 | enemyOf: Resident 6 | appearsIn: [Episode!]! @search 7 | } 8 | 9 | type Human implements Character { 10 | starships: [Starship] 11 | totalCredits: Int 12 | } 13 | 14 | type Droid implements Character { 15 | primaryFunction: String 16 | } 17 | 18 | enum Episode { 19 | NEWHOPE 20 | EMPIRE 21 | JEDI 22 | } 23 | 24 | type Starship { 25 | id: ID! 26 | name: String! @search(by: [term]) 27 | length: Float 28 | } 29 | 30 | union Resident = Human | Droid | Starship 31 | union Tool @remote = Droid | Starship 32 | 33 | type Planet { 34 | id: ID! 35 | name: String! 36 | residents: [Resident!] @dgraph(pred: "residents") 37 | bestTool: Tool @custom(http: { 38 | url: "http://mock:8888/tool/$id" 39 | method: "GET" 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/00.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/12.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/13.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/22.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/0/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/12.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/13.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/12.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/13.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/1_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/12.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/13.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/12.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/13.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/2_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_batch/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_batch/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_batch/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_single/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_single/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_single/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/3_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_batch/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_batch/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_batch/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_single/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_single/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_single/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/4_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/00.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/00.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/02.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | dishes { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/5_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/6_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/10.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/11.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | id 4 | xid 5 | name 6 | pic 7 | rating 8 | costFor2 9 | currency 10 | createdAt 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/12_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/20.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/7_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_batch/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_batch/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_batch/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_batch/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_batch/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_single/queries/01.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine { 3 | id 4 | name 5 | restaurants { 6 | name 7 | rating 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_single/queries/02_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryCuisine (first: 100) { 3 | id 4 | name 5 | restaurants (first: 100) { 6 | name 7 | rating 8 | dishes (first: 100) { 9 | name 10 | price 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_single/queries/13_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryRestaurant { 3 | name 4 | rating 5 | dishes (first: 100) { 6 | name 7 | price 8 | cuisine { 9 | id 10 | name 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_single/queries/21.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /graphql/testdata/custom_bench/profiling/benchmarks/8_single/queries/22_small.query: -------------------------------------------------------------------------------- 1 | query { 2 | queryDish (first: 1000) { 3 | name 4 | price 5 | cuisine { 6 | id 7 | name 8 | restaurants (first: 100) { 9 | name 10 | rating 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /graphql/testdata/datagen/conf.yaml: -------------------------------------------------------------------------------- 1 | graphqlServerUrl: http://localhost:8080/graphql 2 | authorizationHeader: Authorization 3 | jwt: 4 | restaurantDataFilePath: data/file5.json 5 | # 0 means no timeout 6 | httpTimeout: 0 7 | maxErrorsInRestaurantAddition: 10 8 | maxDishes4AnyRestaurant: 3 9 | #data: 10 | # cities: cities.json 11 | # restaurants: restaurants.json 12 | # dishes: dish.json 13 | -------------------------------------------------------------------------------- /graphql/testdata/datagen/data/zomato-restaurants-data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/graphql/testdata/datagen/data/zomato-restaurants-data.zip -------------------------------------------------------------------------------- /graphql/testdata/datagen/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package main 7 | 8 | import "github.com/hypermodeinc/dgraph/v25/graphql/testdata/datagen/cmd" 9 | 10 | func main() { 11 | cmd.Execute() 12 | } 13 | -------------------------------------------------------------------------------- /logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/logo-dark.png -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/logo.png -------------------------------------------------------------------------------- /ocagent/ocagent-config.yaml: -------------------------------------------------------------------------------- 1 | receivers: 2 | jaeger: 3 | collector_http_port: 14268 4 | 5 | exporters: 6 | datadog: 7 | namespace: oc_pool 8 | trace_addr: datadog:8126 9 | enable_tracing: true 10 | -------------------------------------------------------------------------------- /paper/.gitignore: -------------------------------------------------------------------------------- 1 | /dgraph.aux 2 | /dgraph.log 3 | /dgraph.out 4 | /dgraph.bbl 5 | /dgraph.blg 6 | /dgraph.fdb_latexmk 7 | /dgraph.fls 8 | -------------------------------------------------------------------------------- /paper/README: -------------------------------------------------------------------------------- 1 | Steps to compile the paper: 2 | 3 | - Install texcore-full. 4 | - Run bibtex dgraph # without any suffix. 5 | - Run pdflatex dgraph # without any suffix. 6 | -------------------------------------------------------------------------------- /paper/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/architecture.png -------------------------------------------------------------------------------- /paper/datasharding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/datasharding.png -------------------------------------------------------------------------------- /paper/dgraph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/dgraph.pdf -------------------------------------------------------------------------------- /paper/integerstorage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/integerstorage.png -------------------------------------------------------------------------------- /paper/maxassigned-derivation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/maxassigned-derivation.png -------------------------------------------------------------------------------- /paper/maxassigned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/maxassigned.png -------------------------------------------------------------------------------- /paper/mvcc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/mvcc.png -------------------------------------------------------------------------------- /paper/posting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/paper/posting.png -------------------------------------------------------------------------------- /posting/config.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package posting 7 | 8 | import "sync" 9 | 10 | // Options contains options for the postings package. 11 | type Options struct { 12 | sync.Mutex 13 | 14 | CommitFraction float64 15 | } 16 | 17 | // Config stores the posting options of this instance. 18 | var Config Options 19 | -------------------------------------------------------------------------------- /posting/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | // Package posting takes care of posting lists. It contains logic for mutation 7 | // layers, merging them with BadgerDB, etc. 8 | package posting 9 | -------------------------------------------------------------------------------- /posting/size_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | TEST_FAIL=0 3 | # get the p directory 4 | GCS_URL=https://storage.googleapis.com/dgraph-datasets/21million_test_p/p.tar.gz 5 | wget --quiet "${GCS_URL}" || { 6 | echo "ERROR: Download from '${GCS_URL}' failed." >&2 7 | exit 2 8 | } 9 | 10 | #untar it 11 | [[ -f p.tar.gz ]] || { 12 | echo "ERROR: File 'p.tar.gz' does not exist. Exiting" >&2 13 | exit 2 14 | } 15 | tar -xf p.tar.gz 16 | 17 | # get the profiling and size 18 | go test -run Test21MillionDataSet$ -v -manual=true 19 | [[ $? -ne 0 ]] && TEST_FAIL=1 20 | 21 | # compare our calculation with the profile 22 | go test -run Test21MillionDataSetSize$ -v -manual=true 23 | [[ $? -ne 0 ]] && TEST_FAIL=1 24 | 25 | # cleanup (idempotent) 26 | rm -f mem.out 27 | rm -f size.data 28 | rm -rf p 29 | rm -f p.tar.gz 30 | 31 | # report to calling script that test passed or failed 32 | if [[ ${TEST_FAIL} -ne 0 ]]; then 33 | exit 1 34 | else 35 | exit 0 36 | fi 37 | -------------------------------------------------------------------------------- /protos/patch_pb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script modifies the pb.pb.go file to replace certain fields and methods 3 | # to use the custom data type `Sensitive`. 4 | # 5 | # We are doing this because google.golang.org/protobuf does not support custom data types, 6 | # and we have sensitive data that we do not want to expose in logs. 7 | # To address this, we defined a `Sensitive` data type to handle such cases. 8 | # 9 | # This patch script applies the necessary changes to pb.pb.go. 10 | PB_GEN_FILE="./pb/pb.pb.go" 11 | 12 | sed -i 's/SessionToken string/SessionToken Sensitive/' "${PB_GEN_FILE}" 13 | sed -i 's/SecretKey string/SecretKey Sensitive/' "${PB_GEN_FILE}" 14 | 15 | sed -i 's/GetSessionToken() string {/GetSessionToken() Sensitive {/' "${PB_GEN_FILE}" 16 | sed -i 's/GetSecretKey() string/GetSecretKey() Sensitive/' "${PB_GEN_FILE}" 17 | 18 | echo "Patches applied successfully." 19 | -------------------------------------------------------------------------------- /protos/pb/sensitive.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package pb 7 | 8 | // Sensitive implements the Stringer interface to redact its contents. 9 | // Use this type for sensitive info such as keys, passwords, or secrets 10 | // so it doesn't leak as output such as logs. 11 | type Sensitive string 12 | 13 | func (Sensitive) String() string { 14 | return "****" 15 | } 16 | -------------------------------------------------------------------------------- /protos/protos_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package protos 9 | 10 | import ( 11 | "path/filepath" 12 | "runtime" 13 | "testing" 14 | 15 | "github.com/stretchr/testify/require" 16 | 17 | "github.com/hypermodeinc/dgraph/v25/testutil" 18 | ) 19 | 20 | func TestProtosRegenerate(t *testing.T) { 21 | if runtime.GOOS != "linux" { 22 | t.Skip("Skipping test on non-Linux platform") 23 | } 24 | 25 | err := testutil.Exec("make", "regenerate") 26 | require.NoError(t, err, "Got error while regenerating protos: %v\n", err) 27 | 28 | generatedProtos := filepath.Join("pb", "pb.pb.go") 29 | err = testutil.Exec("git", "diff", "-b", "--quiet", "--", generatedProtos) 30 | require.NoError(t, err, "pb.pb.go changed after regenerating") 31 | } 32 | -------------------------------------------------------------------------------- /query/.gitignore: -------------------------------------------------------------------------------- 1 | /w/ 2 | -------------------------------------------------------------------------------- /query/benchmark/actor.0.gob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/query/benchmark/actor.0.gob -------------------------------------------------------------------------------- /query/benchmark/actor.1.gob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/query/benchmark/actor.1.gob -------------------------------------------------------------------------------- /query/benchmark/actor.2.gob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/query/benchmark/actor.2.gob -------------------------------------------------------------------------------- /query/benchmark/director.0.gob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/query/benchmark/director.0.gob -------------------------------------------------------------------------------- /query/benchmark/director.1.gob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/query/benchmark/director.1.gob -------------------------------------------------------------------------------- /query/benchmark/director.2.gob: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/query/benchmark/director.2.gob -------------------------------------------------------------------------------- /query/cloud_test.go: -------------------------------------------------------------------------------- 1 | //go:build cloud 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package query 9 | 10 | import ( 11 | "context" 12 | "testing" 13 | "time" 14 | 15 | "github.com/hypermodeinc/dgraph/v25/dgraphapi" 16 | "github.com/hypermodeinc/dgraph/v25/dgraphtest" 17 | "github.com/hypermodeinc/dgraph/v25/x" 18 | ) 19 | 20 | func TestMain(m *testing.M) { 21 | c, err := dgraphtest.NewDCloudCluster() 22 | x.Panic(err) 23 | 24 | dg, cleanup, err := c.Client() 25 | x.Panic(err) 26 | defer cleanup() 27 | 28 | ctx, cancel := context.WithTimeout(context.Background(), time.Minute) 29 | defer cancel() 30 | x.Panic(dg.LoginIntoNamespace(ctx, dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.RootNamespace)) 31 | 32 | dc = c 33 | client.Dgraph = dg 34 | populateCluster(dc) 35 | m.Run() 36 | } 37 | -------------------------------------------------------------------------------- /query/integration_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package query 9 | 10 | import ( 11 | "context" 12 | "testing" 13 | 14 | "github.com/hypermodeinc/dgraph/v25/dgraphapi" 15 | "github.com/hypermodeinc/dgraph/v25/dgraphtest" 16 | "github.com/hypermodeinc/dgraph/v25/x" 17 | ) 18 | 19 | func TestMain(m *testing.M) { 20 | dc = dgraphtest.NewComposeCluster() 21 | 22 | var err error 23 | var cleanup func() 24 | client, cleanup, err = dc.Client() 25 | x.Panic(err) 26 | defer cleanup() 27 | x.Panic(client.LoginIntoNamespace(context.Background(), dgraphapi.DefaultUser, 28 | dgraphapi.DefaultPassword, x.RootNamespace)) 29 | 30 | populateCluster(dc) 31 | m.Run() 32 | } 33 | -------------------------------------------------------------------------------- /query/test_schema: -------------------------------------------------------------------------------- 1 | age:int 2 | 3 | name: string 4 | address: string 5 | alive: bool 6 | survival_rate: float 7 | dob: dateTime 8 | -------------------------------------------------------------------------------- /query/testdata/a.txt: -------------------------------------------------------------------------------- 1 | [[[ -1185.8203125, 41.27780646738183 ], [ -1189.1162109375, 37.64903402157866 ], [ -1182.1728515625, 36.84446074079564 ], [ -1185.8203125, 41.27780646738183 ]]] 2 | -------------------------------------------------------------------------------- /query/vector/integration_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package query 9 | 10 | import ( 11 | "context" 12 | "testing" 13 | 14 | "github.com/hypermodeinc/dgraph/v25/dgraphapi" 15 | "github.com/hypermodeinc/dgraph/v25/dgraphtest" 16 | "github.com/hypermodeinc/dgraph/v25/x" 17 | ) 18 | 19 | func TestMain(m *testing.M) { 20 | dc = dgraphtest.NewComposeCluster() 21 | 22 | var err error 23 | var cleanup func() 24 | client, cleanup, err = dc.Client() 25 | x.Panic(err) 26 | defer cleanup() 27 | x.Panic(client.LoginIntoNamespace(context.Background(), dgraphapi.DefaultUser, 28 | dgraphapi.DefaultPassword, x.RootNamespace)) 29 | 30 | m.Run() 31 | } 32 | -------------------------------------------------------------------------------- /systest/.gitignore: -------------------------------------------------------------------------------- 1 | data/* 2 | !data/.gitkeep 3 | -------------------------------------------------------------------------------- /systest/1million/alpha.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | alpha1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/alpha1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "8080" 10 | - "9080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: bind 17 | source: ./out/0/p 18 | target: /posting 19 | read_only: false 20 | command: 21 | /gobin/dgraph alpha --my=alpha1:7080 --zero=zero1:5080 -p=/posting --logtostderr -v=2 22 | --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" 23 | -------------------------------------------------------------------------------- /systest/1million/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | zero1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/zero1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "5080" 10 | - "6080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: volume 17 | source: data 18 | target: /data 19 | read_only: false 20 | command: 21 | /gobin/dgraph zero --telemetry "reports=false;" --raft="idx=1" --my=zero1:5080 --logtostderr 22 | -v=2 --bindall 23 | volumes: 24 | data: {} 25 | -------------------------------------------------------------------------------- /systest/21million/bulk/alpha.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | alpha1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/alpha1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "8080" 10 | - "9080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: bind 17 | source: ./out/0/p 18 | target: /posting 19 | read_only: false 20 | command: 21 | /gobin/dgraph alpha --my=alpha1:7080 --zero=zero1:5080 -p=/posting --logtostderr -v=2 22 | --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" 23 | -------------------------------------------------------------------------------- /systest/21million/bulk/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | zero1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/zero1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "5080" 10 | - "6080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: volume 17 | source: data 18 | target: /data 19 | read_only: false 20 | command: 21 | /gobin/dgraph zero --telemetry "reports=false;" --raft="idx=1" --my=zero1:5080 --logtostderr 22 | -v=2 --bindall 23 | volumes: 24 | data: {} 25 | -------------------------------------------------------------------------------- /systest/21million/queries/query-001: -------------------------------------------------------------------------------- 1 | { 2 | bladerunner(func: eq(name@en, "Blade Runner")) { 3 | name@en 4 | initial_release_date 5 | netflix_id 6 | } 7 | } 8 | --- 9 | { 10 | "bladerunner": [ 11 | { 12 | "name@en": "Blade Runner", 13 | "initial_release_date": "1982-06-25T00:00:00Z", 14 | "netflix_id": "70083726" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /systest/21million/queries/query-008: -------------------------------------------------------------------------------- 1 | { 2 | me(func: eq(name@en, "Steven Spielberg")) @filter(has(director.film)) { 3 | name@en 4 | director.film @filter(allofterms(name@en, "jones indiana")) { 5 | name@en 6 | } 7 | } 8 | } 9 | --- 10 | { 11 | "me": [ 12 | { 13 | "name@en": "Steven Spielberg", 14 | "director.film": [ 15 | { 16 | "name@en": "Indiana Jones and the Temple of Doom" 17 | }, 18 | { 19 | "name@en": "Indiana Jones and the Last Crusade" 20 | }, 21 | { 22 | "name@en": "Indiana Jones and the Kingdom of the Crystal Skull" 23 | }, 24 | { 25 | "name@en": "Indiana Jones and the Raiders of the Lost Ark" 26 | } 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /systest/21million/queries/query-010: -------------------------------------------------------------------------------- 1 | { 2 | me(func: eq(name@en, "Steven Spielberg")) @filter(has(director.film)) { 3 | name@en 4 | director.film @filter(anyofterms(name@en, "war spies")) { 5 | name@en 6 | } 7 | } 8 | } 9 | --- 10 | { 11 | "me": [ 12 | { 13 | "name@en": "Steven Spielberg", 14 | "director.film": [ 15 | { 16 | "name@en": "War Horse" 17 | }, 18 | { 19 | "name@en": "War of the Worlds" 20 | }, 21 | { 22 | "name@en": "Bridge of Spies" 23 | } 24 | ] 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /systest/21million/queries/query-014: -------------------------------------------------------------------------------- 1 | { 2 | me(func: eq(name@en, "Ridley Scott")) { 3 | name@en 4 | director.film @filter(lt(initial_release_date, "1980-01-01")) { 5 | initial_release_date 6 | name@en 7 | } 8 | } 9 | } 10 | --- 11 | { 12 | "me": [ 13 | { 14 | "name@en": "Ridley Scott", 15 | "director.film": [ 16 | { 17 | "initial_release_date": "1979-05-25T00:00:00Z", 18 | "name@en": "Alien" 19 | }, 20 | { 21 | "initial_release_date": "1977-12-01T00:00:00Z", 22 | "name@en": "The Duellists" 23 | } 24 | ] 25 | }, 26 | { 27 | "name@en": "Ridley Scott" 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /systest/21million/queries/query-016: -------------------------------------------------------------------------------- 1 | { 2 | genre(func: gt(count(~genre), 30000)) { 3 | name@en 4 | ~genre (first:1, orderasc: name@en) { 5 | name@en 6 | } 7 | } 8 | } 9 | --- 10 | { 11 | "genre": [ 12 | { 13 | "name@en": "Documentary film", 14 | "~genre": [ 15 | { 16 | "name@en": "!Women Art Revolution" 17 | } 18 | ] 19 | }, 20 | { 21 | "name@en": "Drama", 22 | "~genre": [ 23 | { 24 | "name@en": "-30-" 25 | } 26 | ] 27 | }, 28 | { 29 | "name@en": "Comedy", 30 | "~genre": [ 31 | { 32 | "name@en": "¡ El Presidente !" 33 | } 34 | ] 35 | }, 36 | { 37 | "name@en": "Short Film", 38 | "~genre": [ 39 | { 40 | "name@en": ":08 Min. Core Workouts" 41 | } 42 | ] 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /systest/21million/queries/query-020: -------------------------------------------------------------------------------- 1 | { 2 | tourist(func: near(loc, [-122.469829, 37.771935], 1000) ) { 3 | name 4 | } 5 | } 6 | --- 7 | { 8 | "tourist": [] 9 | } 10 | -------------------------------------------------------------------------------- /systest/21million/queries/query-021: -------------------------------------------------------------------------------- 1 | { 2 | tourist(func: contains(loc, [ -122.50326097011566, 37.73353615592843 ] )) { 3 | name 4 | } 5 | } 6 | --- 7 | { 8 | "tourist": [] 9 | } 10 | -------------------------------------------------------------------------------- /systest/21million/queries/query-027: -------------------------------------------------------------------------------- 1 | { 2 | me(func: allofterms(name@en, "Baz Luhrmann")) { 3 | name@en 4 | director.film (first: 5, orderasc: name@en) { 5 | name@en 6 | } 7 | } 8 | } 9 | --- 10 | { 11 | "me": [ 12 | { 13 | "name@en": "Baz Luhrmann", 14 | "director.film": [ 15 | { 16 | "name@en": "Australia" 17 | }, 18 | { 19 | "name@en": "Moulin Rouge!" 20 | }, 21 | { 22 | "name@en": "No. 5 the Film" 23 | }, 24 | { 25 | "name@en": "Puccini: La Boheme (Sydney Opera)" 26 | }, 27 | { 28 | "name@en": "Romeo + Juliet" 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | 35 | -------------------------------------------------------------------------------- /systest/21million/queries/query-029: -------------------------------------------------------------------------------- 1 | { 2 | directors(func: gt(count(director.film), 5)) { 3 | totalDirectors : count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "directors": [ 9 | { 10 | "totalDirectors": 7712 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-040: -------------------------------------------------------------------------------- 1 | { 2 | var(func: allofterms(name@en, "Harry Potter")) { 3 | d as initial_release_date 4 | } 5 | me() { 6 | min(val(d)) 7 | } 8 | } 9 | --- 10 | { 11 | "me": [ 12 | { 13 | "min(val(d))": "2001-11-04T00:00:00Z" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /systest/21million/queries/query-042: -------------------------------------------------------------------------------- 1 | { 2 | var(func: allofterms(name@en, "Harry Potter")) { 3 | d as initial_release_date 4 | } 5 | me() { 6 | max(val(d)) 7 | } 8 | } 9 | --- 10 | { 11 | "me": [ 12 | { 13 | "max(val(d))": "2011-07-27T00:00:00Z" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /systest/21million/queries/query-047: -------------------------------------------------------------------------------- 1 | { 2 | var(func:allofterms(name@en, "steven spielberg")) { 3 | films as director.film { 4 | p as count(starring) 5 | q as count(genre) 6 | r as count(country) 7 | score as math(p + q + r) 8 | } 9 | } 10 | 11 | TopMovies(func: uid(films), orderdesc: val(score), first: 5){ 12 | name@en 13 | val(score) 14 | } 15 | } 16 | --- 17 | { 18 | "TopMovies": [ 19 | { 20 | "name@en": "Lincoln", 21 | "val(score)": 179 22 | }, 23 | { 24 | "name@en": "Minority Report", 25 | "val(score)": 156 26 | }, 27 | { 28 | "name@en": "Schindler's List", 29 | "val(score)": 145 30 | }, 31 | { 32 | "name@en": "The Terminal", 33 | "val(score)": 118 34 | }, 35 | { 36 | "name@en": "Saving Private Ryan", 37 | "val(score)": 99 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /systest/21million/queries/query-048: -------------------------------------------------------------------------------- 1 | { 2 | steven as var(func:eq(name@en, "Steven Spielberg")) @filter(has(director.film)) { 3 | director.film { 4 | p as count(starring) 5 | q as count(genre) 6 | r as count(country) 7 | score as math(p + q + r) 8 | } 9 | directorScore as sum(val(score)) 10 | } 11 | 12 | score(func: uid(steven)){ 13 | name@en 14 | val(directorScore) 15 | } 16 | } 17 | --- 18 | { 19 | "score": [ 20 | { 21 | "name@en": "Steven Spielberg", 22 | "val(directorScore)": 1865 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /systest/21million/queries/query-053: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(starring), 1)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 34821 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-054: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(starring), 2)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 17162 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-055: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(starring), 3)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 15315 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-056: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(starring), 30)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 181 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-057: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(starring), 100)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 10 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-058: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(actor.film), 1)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 309357 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-059: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(actor.film), 2)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 60038 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-060: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(actor.film), 3)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 27311 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-061: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(actor.film), 30)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 326 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-062: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(actor.film), 100)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 10 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-063: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(director.film), 1)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 62640 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-064: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(director.film), 2)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 13684 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-065: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(director.film), 3)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 5847 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-066: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(director.film), 30)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 55 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-067: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(director.film), 100)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 0 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-068: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(~director.film), 1)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 204296 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-069: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(~director.film), 2)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 14761 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-070: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(~director.film), 3)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 1534 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-071: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(~director.film), 30)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 1 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/21million/queries/query-072: -------------------------------------------------------------------------------- 1 | { 2 | q(func: eq(count(~director.film), 100)) { 3 | count: count(uid) 4 | } 5 | } 6 | --- 7 | { 8 | "q": [ 9 | { 10 | "count": 0 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /systest/acl/restore/acl-secret: -------------------------------------------------------------------------------- 1 | 12345678901234567890123456789012 -------------------------------------------------------------------------------- /systest/acl/restore/data/backups/dgraph.20210730.124449.146/r21-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/acl/restore/data/backups/dgraph.20210730.124449.146/r21-g1.backup -------------------------------------------------------------------------------- /systest/audit/audit_dir/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit/audit_dir/.gitkeep -------------------------------------------------------------------------------- /systest/audit/audit_dir/aa/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit/audit_dir/aa/.gitkeep -------------------------------------------------------------------------------- /systest/audit/audit_dir/za/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit/audit_dir/za/.gitkeep -------------------------------------------------------------------------------- /systest/audit_encrypted/audit_dir/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit_encrypted/audit_dir/.gitkeep -------------------------------------------------------------------------------- /systest/audit_encrypted/audit_dir/aa/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit_encrypted/audit_dir/aa/.gitkeep -------------------------------------------------------------------------------- /systest/audit_encrypted/audit_dir/za/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit_encrypted/audit_dir/za/.gitkeep -------------------------------------------------------------------------------- /systest/audit_encrypted/audit_dir_deprecated/aa/alpha_audit_1_1.log.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit_encrypted/audit_dir_deprecated/aa/alpha_audit_1_1.log.enc -------------------------------------------------------------------------------- /systest/audit_encrypted/audit_dir_deprecated/za/zero_audit_0_1.log.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/audit_encrypted/audit_dir_deprecated/za/zero_audit_0_1.log.enc -------------------------------------------------------------------------------- /systest/backup.env: -------------------------------------------------------------------------------- 1 | MINIO_ACCESS_KEY=accesskey 2 | MINIO_SECRET_KEY=secretkey 3 | -------------------------------------------------------------------------------- /systest/backup/filesystem/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/.gitkeep -------------------------------------------------------------------------------- /systest/backup/filesystem/data/backups/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/backups/.gitkeep -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "full", 3 | "since": 68, 4 | "groups": { 5 | "1": [ 6 | "Author.pwd", 7 | "dgraph.graphql.xid", 8 | "dgraph.drop.op", 9 | "dgraph.graphql.schema_history", 10 | "dgraph.graphql.schema_created_at", 11 | "dgraph.type", 12 | "dgraph.graphql.schema", 13 | "dgraph.cors", 14 | "dgraph.graphql.p_query", 15 | "Author.name", 16 | "Person.name" 17 | ], 18 | "2": [], 19 | "3": [] 20 | }, 21 | "backup_id": "loving_jones5", 22 | "backup_num": 1, 23 | "encrypted": false, 24 | "drop_operations": null 25 | } 26 | -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/r68-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/r68-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/r68-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/r68-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/r68-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/1/dgraph.20201125.173944.587/r68-g3.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "full", 3 | "since": 38, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.schema_history", 7 | "dgraph.drop.op", 8 | "dgraph.graphql.p_sha256hash", 9 | "dgraph.graphql.schema", 10 | "dgraph.cors", 11 | "dgraph.type", 12 | "dgraph.graphql.xid", 13 | "dgraph.graphql.schema_created_at", 14 | "dgraph.graphql.p_query" 15 | ], 16 | "2": ["p2", "p1", "p3"], 17 | "3": [] 18 | }, 19 | "backup_id": "jolly_yalow0", 20 | "backup_num": 1, 21 | "encrypted": false, 22 | "drop_operations": null 23 | } 24 | -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/r38-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/r38-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/r38-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/r38-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/r38-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094442.220/r38-g3.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 54, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.p_sha256hash", 7 | "dgraph.graphql.schema", 8 | "dgraph.graphql.schema_history", 9 | "dgraph.drop.op", 10 | "dgraph.type", 11 | "dgraph.cors", 12 | "dgraph.graphql.schema_created_at", 13 | "dgraph.graphql.p_query", 14 | "dgraph.graphql.xid" 15 | ], 16 | "2": ["p4", "p3", "p2", "p1"], 17 | "3": [] 18 | }, 19 | "backup_id": "jolly_yalow0", 20 | "backup_num": 2, 21 | "encrypted": false, 22 | "drop_operations": [{ "drop_op": 1 }] 23 | } 24 | -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/r54-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/r54-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/r54-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/r54-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/r54-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094634.533/r54-g3.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 58, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.p_sha256hash", 7 | "dgraph.graphql.p_query", 8 | "dgraph.drop.op", 9 | "dgraph.graphql.schema_history", 10 | "dgraph.graphql.xid", 11 | "dgraph.graphql.schema", 12 | "dgraph.cors", 13 | "dgraph.graphql.schema_created_at", 14 | "dgraph.type" 15 | ], 16 | "2": ["p1", "p4", "p3", "p2"], 17 | "3": [] 18 | }, 19 | "backup_id": "jolly_yalow0", 20 | "backup_num": 3, 21 | "encrypted": false, 22 | "drop_operations": [{ "drop_op": 2, "drop_value": "p3" }] 23 | } 24 | -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/r58-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/r58-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/r58-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/r58-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/r58-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/2/dgraph.20210517.094648.003/r58-g3.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095641.969/r9-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095641.969/r9-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095641.969/r9-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095641.969/r9-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095641.969/r9-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095641.969/r9-g3.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095716.130/r21-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095716.130/r21-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095716.130/r21-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095716.130/r21-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095716.130/r21-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095716.130/r21-g3.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095726.320/r26-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095726.320/r26-g1.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095726.320/r26-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095726.320/r26-g2.backup -------------------------------------------------------------------------------- /systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095726.320/r26-g3.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/filesystem/data/to_restore/3/dgraph.20210517.095726.320/r26-g3.backup -------------------------------------------------------------------------------- /systest/backup/multi-tenancy/acl-secret: -------------------------------------------------------------------------------- 1 | 12345678901234567890123456789012 -------------------------------------------------------------------------------- /systest/backup/multi-tenancy/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/multi-tenancy/data/.gitkeep -------------------------------------------------------------------------------- /systest/backup/multi-tenancy/data/backups/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/backup/multi-tenancy/data/backups/.gitkeep -------------------------------------------------------------------------------- /systest/backup/nfs-backup/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dgraph/dgraph:local 2 | LABEL maintainer="Hypermode Inc. " 3 | 4 | RUN apt-get update && apt-get install -y --no-install-recommends \ 5 | nfs-client 6 | CMD ["dgraph"] # Shows the dgraph version and commands available. 7 | -------------------------------------------------------------------------------- /systest/bgindex/common_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package main 9 | 10 | import ( 11 | "context" 12 | "fmt" 13 | "sync" 14 | "sync/atomic" 15 | "time" 16 | 17 | "github.com/dgraph-io/dgo/v250" 18 | ) 19 | 20 | func printStats(counter *uint64, quit <-chan struct{}, wg *sync.WaitGroup) { 21 | defer wg.Done() 22 | for { 23 | select { 24 | case <-quit: 25 | return 26 | case <-time.After(2 * time.Second): 27 | } 28 | 29 | fmt.Println("mutations:", atomic.LoadUint64(counter)) 30 | } 31 | } 32 | 33 | // blocks until query returns no error. 34 | func waitForSchemaUpdate(query string, dg *dgo.Dgraph) { 35 | for { 36 | time.Sleep(2 * time.Second) 37 | _, err := dg.NewReadOnlyTxn().Query(context.Background(), query) 38 | if err != nil { 39 | continue 40 | } 41 | 42 | return 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /systest/bulk_live/bulk/alpha.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | alpha1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/alpha1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "8080" 10 | - "9080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: bind 17 | source: ./data/out/0/p 18 | target: /posting 19 | read_only: false 20 | command: 21 | /gobin/dgraph alpha --my=alpha1:7080 --zero=zero1:5080 --logtostderr -v=2 -p=/posting 22 | --security "whitelist=0.0.0.0/0;" 23 | -------------------------------------------------------------------------------- /systest/bulk_live/bulk/alpha_acl.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | alpha1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/alpha1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "8080" 10 | - "9080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: bind 17 | source: ./data/out/0/p 18 | target: /posting 19 | read_only: false 20 | - type: bind 21 | source: ../../../acl/hmac-secret 22 | target: /dgraph-acl/hmac-secret 23 | read_only: true 24 | command: 25 | /gobin/dgraph alpha --my=alpha1:7080 --zero=zero1:5080 --logtostderr -v=2 -p=/posting 26 | --security "whitelist=0.0.0.0/0;" --acl "secret-file=/dgraph-acl/hmac-secret; " 27 | -------------------------------------------------------------------------------- /systest/bulk_live/bulk/bulk_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package main 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/hypermodeinc/dgraph/v25/systest/bulk_live/common" 14 | ) 15 | 16 | func TestBulkCases(t *testing.T) { 17 | t.Run("bulk test cases", common.RunBulkCases) 18 | } 19 | 20 | func TestBulkCasesAcl(t *testing.T) { 21 | t.Run("bulk test cases with acl", common.RunBulkCasesAcl) 22 | } 23 | -------------------------------------------------------------------------------- /systest/bulk_live/bulk/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Auto-generated with: [../../../compose/compose -z=1 -a=0 -o=0 --minio --minio_data_dir=. --expose_ports=false --names=false] 2 | # 3 | version: "3.5" 4 | services: 5 | minio: 6 | image: minio/minio:RELEASE.2020-11-13T20-10-18Z 7 | ports: 8 | - "9001" 9 | env_file: 10 | - ../../backup.env 11 | command: minio server /data/minio --address :9001 12 | zero1: 13 | image: dgraph/dgraph:local 14 | working_dir: /data/zero1 15 | labels: 16 | cluster: test 17 | ports: 18 | - "5080" 19 | - "6080" 20 | volumes: 21 | - type: bind 22 | source: $GOPATH/bin 23 | target: /gobin 24 | read_only: true 25 | command: 26 | /gobin/dgraph zero --telemetry "reports=false;" --raft='idx=1' --my=zero1:5080 --logtostderr 27 | -v=2 --bindall 28 | deploy: 29 | resources: 30 | limits: 31 | memory: 32G 32 | volumes: {} 33 | -------------------------------------------------------------------------------- /systest/bulk_live/live/live_test.go: -------------------------------------------------------------------------------- 1 | //go:build integration 2 | 3 | /* 4 | * SPDX-FileCopyrightText: © Hypermode Inc. 5 | * SPDX-License-Identifier: Apache-2.0 6 | */ 7 | 8 | package live 9 | 10 | import ( 11 | "testing" 12 | 13 | "github.com/hypermodeinc/dgraph/v25/systest/bulk_live/common" 14 | ) 15 | 16 | func TestLiveCases(t *testing.T) { 17 | t.Run("live test cases", common.RunLiveCases) 18 | } 19 | -------------------------------------------------------------------------------- /systest/cdc/cdc_logs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/cdc/cdc_logs/.gitkeep -------------------------------------------------------------------------------- /systest/data/goldendata.rdf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/data/goldendata.rdf.gz -------------------------------------------------------------------------------- /systest/data/goldendata.schema: -------------------------------------------------------------------------------- 1 | name: string @index(term) @lang . 2 | initial_release_date: datetime @index(year) . 3 | -------------------------------------------------------------------------------- /systest/data/goldendata_export.rdf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/data/goldendata_export.rdf.gz -------------------------------------------------------------------------------- /systest/data/goldendata_first_200k.rdf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/data/goldendata_first_200k.rdf.gz -------------------------------------------------------------------------------- /systest/export/export.env: -------------------------------------------------------------------------------- 1 | MINIO_ACCESS_KEY=accesskey 2 | MINIO_SECRET_KEY=secretkey 3 | -------------------------------------------------------------------------------- /systest/group-delete/README.md: -------------------------------------------------------------------------------- 1 | # Group Delete Test 2 | 3 | This test runs a scenario where nodes are removed from groups to make zero delete those groups. At 4 | every stage we check the zero state to make sure the nodes and groups are deleted. 5 | 6 | Process: 7 | 8 | 1. Bring up a cluster with 3 groups, 1 node each. 9 | 2. Delete node from group 3 10 | 3. Check that zero deleted group 3 11 | 4. Run a query to test that the cluster is viable 12 | 5. Delete node from group 2 13 | 6. Check that zero deleted group 2 14 | 7. Run a query to test that the cluster is viable 15 | -------------------------------------------------------------------------------- /systest/ldbc/alpha.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | alpha1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/alpha1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "8080" 10 | - "9080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | - type: bind 17 | source: ./out/0/p 18 | target: /posting 19 | read_only: false 20 | command: 21 | /gobin/dgraph ${COVERAGE_OUTPUT} alpha --my=alpha1:7080 --zero=zero1:5080 -p=/posting 22 | --logtostderr -v=2 --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" 23 | -------------------------------------------------------------------------------- /systest/ldbc/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.5" 2 | services: 3 | zero1: 4 | image: dgraph/dgraph:local 5 | working_dir: /data/zero1 6 | labels: 7 | cluster: test 8 | ports: 9 | - "5080" 10 | - "6080" 11 | volumes: 12 | - type: bind 13 | source: $GOPATH/bin 14 | target: /gobin 15 | read_only: true 16 | command: 17 | /gobin/dgraph ${COVERAGE_OUTPUT} zero --telemetry "reports=false;" --raft="idx=1" 18 | --my=zero1:5080 --logtostderr -v=2 --bindall 19 | -------------------------------------------------------------------------------- /systest/loader/testdata/first.rdf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/loader/testdata/first.rdf.gz -------------------------------------------------------------------------------- /systest/loader/testdata/second.rdf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/loader/testdata/second.rdf.gz -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210005.792/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "full", 3 | "since": 30, 4 | "groups": { "1": ["dgraph.graphql.schema", "dgraph.type", "dgraph.graphql.xid"], "2": [] }, 5 | "backup_id": "youthful_rhodes3", 6 | "backup_num": 1, 7 | "encrypted": true 8 | } 9 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210005.792/r30-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210005.792/r30-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210005.792/r30-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210005.792/r30-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210012.038/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 30, 4 | "groups": { "1": ["dgraph.type", "dgraph.graphql.xid", "dgraph.graphql.schema"], "2": [] }, 5 | "backup_id": "youthful_rhodes3", 6 | "backup_num": 2, 7 | "encrypted": true 8 | } 9 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210012.038/r30-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210012.038/r30-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210012.038/r30-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210012.038/r30-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210106.464/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 28, 4 | "groups": { "1": ["dgraph.type", "dgraph.graphql.xid", "dgraph.graphql.schema"], "2": [] }, 5 | "backup_id": "youthful_rhodes3", 6 | "backup_num": 3, 7 | "encrypted": true 8 | } 9 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210106.464/r28-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210106.464/r28-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210106.464/r28-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210106.464/r28-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210343.124/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 2117, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.xid", 7 | "performance.character", 8 | "email", 9 | "dgraph.type", 10 | "loc", 11 | "genre", 12 | "actor.film", 13 | "performance.film", 14 | "initial_release_date", 15 | "rated", 16 | "performance.actor", 17 | "starring", 18 | "cut.note", 19 | "director.film", 20 | "dgraph.graphql.schema", 21 | "country", 22 | "performance.character_note", 23 | "rating" 24 | ], 25 | "2": ["tagline", "name"] 26 | }, 27 | "backup_id": "youthful_rhodes3", 28 | "backup_num": 4, 29 | "encrypted": true 30 | } 31 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210343.124/r2117-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210343.124/r2117-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.210343.124/r2117-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.210343.124/r2117-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.212208.094/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "full", 3 | "since": 37, 4 | "groups": { 5 | "1": ["dgraph.graphql.schema", "dgraph.type", "dgraph.graphql.xid"], 6 | "2": ["name", "tagline"] 7 | }, 8 | "backup_id": "blissful_hermann1", 9 | "backup_num": 1, 10 | "encrypted": true 11 | } 12 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.212208.094/r37-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.212208.094/r37-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups/dgraph.20200617.212208.094/r37-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups/dgraph.20200617.212208.094/r37-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130427.532/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "full", 3 | "since": 55, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.schema_created_at", 7 | "dgraph.graphql.schema", 8 | "dgraph.drop.op", 9 | "dgraph.cors", 10 | "dgraph.graphql.xid", 11 | "dgraph.graphql.p_sha256hash", 12 | "dgraph.graphql.p_query", 13 | "dgraph.type", 14 | "dgraph.graphql.schema_history" 15 | ], 16 | "2": ["name"] 17 | }, 18 | "backup_id": "wizardly_blackburn2", 19 | "backup_num": 1, 20 | "encrypted": false, 21 | "drop_operations": null 22 | } 23 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130427.532/r55-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130427.532/r55-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130427.532/r55-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130427.532/r55-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130444.413/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 58, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.p_sha256hash", 7 | "dgraph.graphql.p_query", 8 | "dgraph.graphql.schema_created_at", 9 | "dgraph.cors", 10 | "dgraph.graphql.schema_history", 11 | "dgraph.type", 12 | "dgraph.graphql.schema", 13 | "dgraph.drop.op", 14 | "dgraph.graphql.xid" 15 | ], 16 | "2": ["name", "age"] 17 | }, 18 | "backup_id": "wizardly_blackburn2", 19 | "backup_num": 2, 20 | "encrypted": false, 21 | "drop_operations": null 22 | } 23 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130444.413/r58-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130444.413/r58-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130444.413/r58-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130444.413/r58-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130453.552/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 68, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.schema", 7 | "dgraph.type", 8 | "dgraph.graphql.p_query", 9 | "dgraph.graphql.schema_created_at", 10 | "dgraph.graphql.xid", 11 | "dgraph.graphql.schema_history", 12 | "dgraph.drop.op", 13 | "dgraph.graphql.p_sha256hash", 14 | "dgraph.cors" 15 | ], 16 | "2": ["name", "age"] 17 | }, 18 | "backup_id": "wizardly_blackburn2", 19 | "backup_num": 3, 20 | "encrypted": false, 21 | "drop_operations": [{ "drop_op": 2, "drop_value": "name" }] 22 | } 23 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130453.552/r68-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130453.552/r68-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130453.552/r68-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130453.552/r68-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130519.083/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 72, 4 | "groups": { 5 | "1": [ 6 | "dgraph.type", 7 | "dgraph.graphql.schema_created_at", 8 | "dgraph.graphql.schema_history", 9 | "dgraph.graphql.xid", 10 | "dgraph.graphql.p_query", 11 | "dgraph.graphql.schema", 12 | "dgraph.drop.op", 13 | "dgraph.cors", 14 | "dgraph.graphql.p_sha256hash" 15 | ], 16 | "2": ["age", "name"] 17 | }, 18 | "backup_id": "wizardly_blackburn2", 19 | "backup_num": 4, 20 | "encrypted": false, 21 | "drop_operations": null 22 | } 23 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130519.083/r72-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130519.083/r72-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130519.083/r72-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130519.083/r72-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130544.666/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 86, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.xid", 7 | "dgraph.graphql.schema", 8 | "dgraph.drop.op", 9 | "dgraph.type", 10 | "dgraph.cors", 11 | "dgraph.graphql.schema_created_at", 12 | "dgraph.graphql.schema_history", 13 | "dgraph.graphql.p_query", 14 | "dgraph.graphql.p_sha256hash" 15 | ], 16 | "2": ["age", "name"] 17 | }, 18 | "backup_id": "wizardly_blackburn2", 19 | "backup_num": 5, 20 | "encrypted": false, 21 | "drop_operations": [{ "drop_op": 1 }] 22 | } 23 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130544.666/r86-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130544.666/r86-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130544.666/r86-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130544.666/r86-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130634.385/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "incremental", 3 | "since": 104, 4 | "groups": { 5 | "1": [ 6 | "dgraph.graphql.p_sha256hash", 7 | "dgraph.graphql.schema", 8 | "dgraph.graphql.p_query", 9 | "dgraph.cors", 10 | "dgraph.graphql.schema_history", 11 | "dgraph.graphql.schema_created_at", 12 | "dgraph.type", 13 | "dgraph.graphql.xid", 14 | "dgraph.drop.op" 15 | ], 16 | "2": ["name", "age"] 17 | }, 18 | "backup_id": "wizardly_blackburn2", 19 | "backup_num": 6, 20 | "encrypted": false, 21 | "drop_operations": [{}] 22 | } 23 | -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130634.385/r104-g1.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130634.385/r104-g1.backup -------------------------------------------------------------------------------- /systest/online-restore/backup/backups2011/dgraph.20210706.130634.385/r104-g2.backup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/backup/backups2011/dgraph.20210706.130634.385/r104-g2.backup -------------------------------------------------------------------------------- /systest/online-restore/keys/enc_key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/online-restore/keys/enc_key -------------------------------------------------------------------------------- /systest/online-restore/queries/query-001: -------------------------------------------------------------------------------- 1 | { 2 | bladerunner(func: eq(name@en, "Blade Runner")) { 3 | name@en 4 | initial_release_date 5 | } 6 | } 7 | --- 8 | { 9 | "bladerunner": [ 10 | { 11 | "name@en": "Blade Runner", 12 | "initial_release_date": "1982-06-25T00:00:00Z" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /systest/shortest-path/graph.rdf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/shortest-path/graph.rdf.gz -------------------------------------------------------------------------------- /systest/shortest-path/graph.schema.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hypermodeinc/dgraph/2314f84b1274298c170a1a6d0235f0cc01b2b2fa/systest/shortest-path/graph.schema.gz -------------------------------------------------------------------------------- /t/.gitignore: -------------------------------------------------------------------------------- 1 | /t 2 | *.log 3 | -------------------------------------------------------------------------------- /testutil/README.md: -------------------------------------------------------------------------------- 1 | ## package z 2 | 3 | This package is for code that is only used in tests (i.e. "\*\_test.go" files). It should not be 4 | used in non-test code because error handling is usually minimal and usually fatal. 5 | -------------------------------------------------------------------------------- /testutil/custom_plugins/anagram/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package main 7 | 8 | import "sort" 9 | 10 | func Tokenizer() interface{} { return AnagramTokenizer{} } 11 | 12 | type AnagramTokenizer struct{} 13 | 14 | func (AnagramTokenizer) Name() string { return "anagram" } 15 | func (AnagramTokenizer) Type() string { return "string" } 16 | func (AnagramTokenizer) Identifier() byte { return 0xfc } 17 | 18 | func (t AnagramTokenizer) Tokens(value interface{}) ([]string, error) { 19 | b := []byte(value.(string)) 20 | sort.Slice(b, func(i, j int) bool { return b[i] < b[j] }) 21 | return []string{string(b)}, nil 22 | } 23 | -------------------------------------------------------------------------------- /testutil/custom_plugins/cidr/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package main 7 | 8 | import "net" 9 | 10 | func Tokenizer() interface{} { return CIDRTokenizer{} } 11 | 12 | type CIDRTokenizer struct{} 13 | 14 | func (CIDRTokenizer) Name() string { return "cidr" } 15 | func (CIDRTokenizer) Type() string { return "string" } 16 | func (CIDRTokenizer) Identifier() byte { return 0xff } 17 | 18 | func (t CIDRTokenizer) Tokens(value interface{}) ([]string, error) { 19 | _, ipnet, err := net.ParseCIDR(value.(string)) 20 | if err != nil { 21 | return nil, err 22 | } 23 | ones, bits := ipnet.Mask.Size() 24 | var toks []string 25 | for i := ones; i >= 1; i-- { 26 | m := net.CIDRMask(i, bits) 27 | tok := net.IPNet{ 28 | IP: ipnet.IP.Mask(m), 29 | Mask: m, 30 | } 31 | toks = append(toks, tok.String()) 32 | } 33 | return toks, nil 34 | } 35 | -------------------------------------------------------------------------------- /testutil/custom_plugins/rune/main.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package main 7 | 8 | import "encoding/binary" 9 | 10 | func Tokenizer() interface{} { return RuneTokenizer{} } 11 | 12 | type RuneTokenizer struct{} 13 | 14 | func (RuneTokenizer) Name() string { return "rune" } 15 | func (RuneTokenizer) Type() string { return "string" } 16 | func (RuneTokenizer) Identifier() byte { return 0xfd } 17 | 18 | func (t RuneTokenizer) Tokens(value interface{}) ([]string, error) { 19 | var toks []string 20 | for _, r := range value.(string) { 21 | var buf [binary.MaxVarintLen32]byte 22 | n := binary.PutVarint(buf[:], int64(r)) 23 | tok := string(buf[:n]) 24 | toks = append(toks, tok) 25 | } 26 | return toks, nil 27 | } 28 | -------------------------------------------------------------------------------- /testutil/minio.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package testutil 7 | 8 | import ( 9 | "github.com/minio/minio-go/v6" 10 | ) 11 | 12 | // NewMinioClient returns a minio client. 13 | func NewMinioClient() (*minio.Client, error) { 14 | return minio.New(MinioInstance, "accesskey", "secretkey", false) 15 | } 16 | -------------------------------------------------------------------------------- /tok/index/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package index 7 | 8 | // TypeID represents the type of the data. 9 | type TypeID Posting_ValType 10 | type Posting_ValType int32 11 | 12 | type KeyValue struct { 13 | // Entity is the uid of the key to be built 14 | Entity uint64 `protobuf:"fixed64,1,opt,name=entity,proto3" json:"entity,omitempty"` 15 | // Attr is the attribute of the key to be built 16 | Attr string `protobuf:"bytes,2,opt,name=attr,proto3" json:"attr,omitempty"` 17 | // Value is the value corresponding to the key built from entity & attr 18 | Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` 19 | } 20 | -------------------------------------------------------------------------------- /worker/README.md: -------------------------------------------------------------------------------- 1 | To update the protocol buffer definitions, run this from one directory above: 2 | 3 | ```bash 4 | protoc -I worker worker/payload.proto --gofast_out=plugins=grpc:worker 5 | ``` 6 | -------------------------------------------------------------------------------- /worker/aggregator.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package worker 7 | 8 | import ( 9 | "github.com/hypermodeinc/dgraph/v25/types" 10 | ) 11 | 12 | func couldApplyAggregatorOn(agrtr string, typ types.TypeID) bool { 13 | if !typ.IsScalar() { 14 | return false 15 | } 16 | switch agrtr { 17 | case "min", "max": 18 | return typ == types.IntID || 19 | typ == types.FloatID || 20 | typ == types.DateTimeID || 21 | typ == types.StringID || 22 | typ == types.DefaultID 23 | case "sum", "avg": 24 | return typ == types.IntID || 25 | typ == types.FloatID || 26 | typ == types.VFloatID 27 | default: 28 | return false 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /worker/compare.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package worker 7 | 8 | func evalCompare(cmp string, lv, rv int64) bool { 9 | switch cmp { 10 | case "le": 11 | return lv <= rv 12 | case "ge": 13 | return lv >= rv 14 | case "lt": 15 | return lv < rv 16 | case "gt": 17 | return lv > rv 18 | case "eq": 19 | return lv == rv 20 | } 21 | panic("EvalCompare: unreachable") 22 | } 23 | -------------------------------------------------------------------------------- /worker/match_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package worker 7 | 8 | import ( 9 | "testing" 10 | 11 | "github.com/stretchr/testify/require" 12 | ) 13 | 14 | func TestDistance(t *testing.T) { 15 | require.Equal(t, 0, levenshteinDistance("detour", "detour")) 16 | require.Equal(t, 1, levenshteinDistance("detour", "det.our")) 17 | require.Equal(t, 2, levenshteinDistance("detour", "det..our")) 18 | require.Equal(t, 4, levenshteinDistance("detour", "..det..our")) 19 | require.Equal(t, 2, levenshteinDistance("detour", "detour..")) 20 | require.Equal(t, 3, levenshteinDistance("detour", "detour...")) 21 | require.Equal(t, 3, levenshteinDistance("detour", "...detour")) 22 | require.Equal(t, 3, levenshteinDistance("detour", "..detour.")) 23 | require.Equal(t, 1, levenshteinDistance("detour", "detoar")) 24 | require.Equal(t, 6, levenshteinDistance("detour", "DETOUR")) 25 | } 26 | -------------------------------------------------------------------------------- /x/disk_metrics_others.go: -------------------------------------------------------------------------------- 1 | //go:build !linux 2 | // +build !linux 3 | 4 | /* 5 | * SPDX-FileCopyrightText: © Hypermode Inc. 6 | * SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | package x 10 | 11 | import ( 12 | "github.com/golang/glog" 13 | 14 | "github.com/dgraph-io/ristretto/v2/z" 15 | ) 16 | 17 | func MonitorDiskMetrics(_ string, _ string, lc *z.Closer) { 18 | defer lc.Done() 19 | glog.Infoln("File system metrics are not currently supported on non-Linux platforms") 20 | } 21 | -------------------------------------------------------------------------------- /x/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | // Package x contains some very common utilities used by Dgraph. These utilities 7 | // are of "miscellaneous" nature, e.g., error checking. 8 | package x 9 | -------------------------------------------------------------------------------- /x/error_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package x 7 | 8 | import ( 9 | "flag" 10 | "fmt" 11 | "testing" 12 | ) 13 | 14 | func TestMain(m *testing.M) { 15 | flag.Parse() 16 | if err := flag.Set("debugmode", "true"); err != nil { 17 | fmt.Printf("error setting debug mode: %v\n", err) 18 | } 19 | 20 | m.Run() 21 | } 22 | -------------------------------------------------------------------------------- /x/subcommand.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package x 7 | 8 | import ( 9 | "github.com/spf13/cobra" 10 | "github.com/spf13/viper" 11 | ) 12 | 13 | // SubCommand a represents a sub-command in the command-line interface. 14 | type SubCommand struct { 15 | Cmd *cobra.Command 16 | Conf *viper.Viper 17 | 18 | EnvPrefix string 19 | } 20 | -------------------------------------------------------------------------------- /x/types.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package x 7 | 8 | type ExportedGQLSchema struct { 9 | Namespace uint64 10 | Schema string 11 | } 12 | 13 | // Sensitive implements the Stringer interface to redact its contents. 14 | // Use this type for sensitive info such as keys, passwords, or secrets so it doesn't leak 15 | // as output such as logs. 16 | type Sensitive []byte 17 | 18 | func (Sensitive) String() string { 19 | return "****" 20 | } 21 | -------------------------------------------------------------------------------- /x/ulimit_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | /* 5 | * SPDX-FileCopyrightText: © Hypermode Inc. 6 | * SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | package x 10 | 11 | import ( 12 | "golang.org/x/sys/unix" 13 | ) 14 | 15 | func QueryMaxOpenFiles() (int, error) { 16 | var rl unix.Rlimit 17 | err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rl) 18 | return int(rl.Cur), err 19 | } 20 | -------------------------------------------------------------------------------- /x/ulimit_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | /* 5 | * SPDX-FileCopyrightText: © Hypermode Inc. 6 | * SPDX-License-Identifier: Apache-2.0 7 | */ 8 | 9 | package x 10 | 11 | import "github.com/pkg/errors" 12 | 13 | func QueryMaxOpenFiles() (int, error) { 14 | return 0, errors.New("Cannot detect max open files on this platform") 15 | } 16 | -------------------------------------------------------------------------------- /x/values_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: © Hypermode Inc. 3 | * SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | package x 7 | 8 | import ( 9 | "testing" 10 | 11 | "github.com/stretchr/testify/require" 12 | ) 13 | 14 | func TestValueType(t *testing.T) { 15 | require.Equal(t, ValueType(false, false, false), ValueUid) 16 | require.Equal(t, ValueType(false, false, true), ValueEmpty) 17 | require.Equal(t, ValueType(false, true, false), ValueUid) 18 | require.Equal(t, ValueType(false, true, true), ValueEmpty) 19 | require.Equal(t, ValueType(true, false, false), ValuePlain) 20 | require.Equal(t, ValueType(true, false, true), ValuePlain) 21 | require.Equal(t, ValueType(true, true, false), ValueMulti) 22 | require.Equal(t, ValueType(true, true, true), ValueMulti) 23 | } 24 | --------------------------------------------------------------------------------