graphql-engine/server/tests-py/queries/v1/metadata/pg_source_namespace_query.yaml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

114 lines
2.1 KiB
YAML
Raw Normal View History

- description: PG add source
url: /v1/metadata
status: 200
response:
message: success
query:
type: pg_add_source
args:
name: pg1
configuration:
connection_info:
database_url:
from_env: HASURA_GRAPHQL_PG_SOURCE_URL_1
pool_settings:
max_connections: 50
idle_timeout: 180
retries:
customization:
root_fields:
namespace: my_source
type_names:
prefix: foo_
- description: create table 1
url: /v1/query
status: 200
response:
result_type: CommandOk
result:
query:
type: run_sql
args:
source: pg1
sql: |
create table author_local(
id serial primary key,
name text unique
);
INSERT INTO author_local (name)
VALUES ('Author 1'), ('Author 2');
- description: track table
url: /v1/metadata
status: 200
response:
message: success
query:
type: pg_track_table
args:
table: author_local
source: pg1
- description: Simple GraphQL query to fetch items from the source table
url: /v1/graphql
status: 200
response:
data:
my_source:
__typename: foo_my_source_query
author_local:
- id: 1
name: 'Author 1'
__typename: foo_author_local
- id: 2
name: 'Author 2'
__typename: foo_author_local
query:
query: |
query {
my_source {
__typename
author_local {
id
name
__typename
}
}
}
- description: untrack table
url: /v1/metadata
status: 200
response:
message: success
query:
type: pg_untrack_table
args:
table: author_local
source: pg1
- description: drop table
url: /v1/query
status: 200
response:
result_type: CommandOk
result:
query:
type: run_sql
args:
source: pg1
sql: |
drop table author_local;
- description: PG Drop Source 1
url: /v1/metadata
status: 200
response:
message: success
query:
type: pg_drop_source
args:
name: pg1