Abonnementen op Complexe Records
In de volgende voorbeelden hebben we een tabel genaamd students, die velden en relaties bevat zoals id, firstName, email, age.
Abonnementen met filters
Section titled “Abonnementen met filters”U kunt zich abonneren op individuele en gerelateerde records die worden gemaakt, bijgewerkt en verwijderd met behulp van de automatisch gegenereerde GraphQL-abonnementsbewerking van Archie Core.
Beschikbare Operators
Section titled “Beschikbare Operators”| Operator | Gebruiksvoorbeeld |
|---|---|
eq | status = "active" |
neq | type != "admin" |
gt | age > 18 |
lt | price < 100 |
gte | score >= 80 |
lte | attempts <= 3 |
contains | name contains "john" |
startsWith | email startsWith "admin" |
endsWith | domain endsWith ".com" |
Meerdere Voorwaarden (Logische AND)
Section titled “Meerdere Voorwaarden (Logische AND)”GraphQL Mutatie
Section titled “GraphQL Mutatie”mutation createNewSubscription($input: SubscriptionInput!) { system { createSubscription(input: $input) { id active name } }}Variabelen
Section titled “Variabelen”{ "input": { "name": "students_create_gte_lte", "description": "Subscription - students table - create - gte lte", "active": true, "tables": [ { "table": "students", "operations": ["CREATE"], "fields": ["id", "first_name", "email", "age"], "conditions": [ { "field": "age", "operator": "GTE", "value": "25" }, { "field": "age", "operator": "LTE", "value": "50" } ] } ] }}Antwoord
Section titled “Antwoord”{ "data": { "system": { "createSubscription": { "id": "id_subscription", "active": true, "name": "students_create_gte_lte" } } }}Meerdere Tabellen
Section titled “Meerdere Tabellen”GraphQL Mutatie
Section titled “GraphQL Mutatie”mutation createNewSubscription($input: SubscriptionInput!) { system { createSubscription(input: $input) { id active name } }}Variabelen
Section titled “Variabelen”{ "input": { "name": "multiple_tables", "description": "Subscription multiple tables", "active": true, "tables": [ { "table": "students", "operations": ["CREATE"], "fields": ["id", "first_name", "email", "age"], "conditions": [ { "field": "age", "operator": "GTE", "value": "30" }, { "field": "age", "operator": "LTE", "value": "60" } ] }, { "table": "courses", "operations": ["UPDATE"], "fields": ["id", "code", "name_course", "price"], "conditions": [ { "field": "price", "operator": "LTE", "value": "500" } ] } ] }}Antwoord
Section titled “Antwoord”{ "data": { "system": { "createSubscription": { "id": "id_subscription", "active": true, "name": "multiple_tables" } } }}