You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dbquery/custom-query/api.graphql
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ type Query {
37
37
- `type`: Specifies the type of database being queried. In this case, it’s a PostgreSQL database.
38
38
- `configuration`: References the database configuration (connection details) in StepZen.
39
39
40
-
This query does not take any arguments, and hence there are no parameter markers in the SQL query.
40
+
This field does not take any arguments, and hence there are no parameter markers in the SQL query.
41
41
The SQL query is static, always returning all customers from the database.
42
42
"""
43
43
customers: [Customer]
@@ -51,17 +51,16 @@ type Query {
51
51
Fetches a single customer by their ID from the database.
52
52
53
53
**Field Argument to Parameter Marker Mapping**:
54
-
- The `id` argument provided in the GraphQL query maps to the `$1` marker in the SQL query.
55
-
- SQL queries typically use numbered markers (e.g., `$1`, `$2`, etc.) for parameterized inputs. The number refers to the position of the argument in the query.
56
-
- When a query is executed, the value passed to the `id` argument in GraphQL (via variables) will replace the `$1` marker in the SQL query.
54
+
- Maps the `id` argument to the `$1` marker in the SQL query, allowing dynamic ID-based retrieval.
55
+
- `$1` serves as a placeholder, which will be replaced by the provided `id` value during execution.
57
56
58
57
**@dbquery Directive Usage**:
59
58
- `query`: This is the SQL query that will be executed. Here, the customer data is fetched based on the provided `id` value.
60
59
- The `$1` marker is a placeholder for the value of the `id` argument, which is passed as a variable when executing the query.
61
60
- `type`: Specifies the type of database being queried (PostgreSQL).
62
61
- `configuration`: References the database configuration (connection details) in StepZen.
63
62
64
-
This query requires an `id` argument as input, which is passed as a variable from the GraphQL query. The variable's value is used to fetch the corresponding customer from the database.
63
+
This field requires an `id` argument as input, which is passed as a variable from the GraphQL request. The variable's value is used to fetch the corresponding customer from the database.
0 commit comments