graphql-engine/server/tests-py/queries/remote_schemas/remote_relationships/setup_address.yaml
Tirumarai Selvan c0d2bc6653
Remote Joins: Create relationships across database and remote schemas (#2392)
add remote joins: Create relationships across database and remote schemas (#2392)

Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>

Co-authored-by: Chris Done <chrisdone@gmail.com>
Co-authored-by: Chris Done <github@chrisdone.com>
Co-authored-by: wawhal <rishichandra.wawhal@gmail.com>
Co-authored-by: Aravind Shankar <aravind@hasura.io>
Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: Rishichandra Wawhal <rishi@hasura.io>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
Co-authored-by: nizar-m <19857260+nizar-m@users.noreply.github.com>
Co-authored-by: Praveen Durairaju <praveend.web@gmail.com>
Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Anon Ray <rayanon004@gmail.com>
Co-authored-by: Shahidh K Muhammed <shahidh@hasura.io>
Co-authored-by: soorajshankar <soorajshankar@users.noreply.github.com>
Co-authored-by: Sooraj Sanker <sooraj@Soorajs-MacBook-Pro.local>
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
2020-05-27 20:32:58 +05:30

45 lines
1.0 KiB
YAML

type: bulk
args:
- type: run_sql
args:
sql: |
create table address (
address_id serial primary key,
user_id integer references profiles(id),
address_line text
)
- type: run_sql
args:
sql: |
insert into address (user_id, address_line) values
( 1, 'address-1' ),
( 2, 'address-2' ),
( 3, 'address-3'),
( 1, 'address-1b')
- type: track_table
args:
name: address
- type: create_object_relationship
args:
name: myProfile
table: address
using:
foreign_key_constraint_on: user_id
- type: create_array_relationship
args:
name: myAddresses
table: profiles
using:
foreign_key_constraint_on:
table: address
column: user_id
- type: create_object_relationship
args:
name: mySpecialAddress
table: profiles
using:
manual_configuration:
remote_table: address
column_mapping:
id: address_id