1
1
---
2
2
sidebar_position : 4
3
- sidebar_label : " Commands modify data"
4
- description : " Commands allow you to modify data in your data source."
3
+ sidebar_label : " Commands act on data"
4
+ description : " Commands allow you to act on data in your data source."
5
5
toc_max_heading_level : 4
6
6
keywords :
7
7
- command
@@ -13,17 +13,20 @@ import TabItem from "@theme/TabItem";
13
13
import Thumbnail from " @site/src/components/Thumbnail" ;
14
14
15
15
import CommandCreateClickHouse from " @site/docs/data-modeling/partials/classic-connectors/clickHouse/_command-create-tutorial.mdx" ;
16
- import CommandCreateClickHouseNativeMutationTutorial from " @site/docs/data-modeling/partials/classic-connectors/clickHouse/_command-create-native-mutation-tutorial .mdx" ;
17
- import CommandCreateClickHouseNativeMutationHowTo from " @site/docs/data-modeling/partials/classic-connectors/clickHouse/_command-create-native-mutation-how-to .mdx" ;
16
+ import CommandCreateClickHouseNativeOperationHowTo from " @site/docs/data-modeling/partials/classic-connectors/clickHouse/_command-create-native-operation-how-to .mdx" ;
17
+ import CommandCreateClickHouseNativeOperationTutorial from " @site/docs/data-modeling/partials/classic-connectors/clickHouse/_command-create-native-operation-tutorial .mdx" ;
18
18
import CommandCreateLambdaGo from " @site/docs/data-modeling/partials/lambda-connectors/go/_command-create-tutorial.mdx" ;
19
+ import CommandCreateLambdaGoNativeOperationHowTo from " @site/docs/data-modeling/partials/lambda-connectors/go/_command-create-native-operation-how-to.mdx" ;
19
20
import CommandCreateLambdaPython from " @site/docs/data-modeling/partials/lambda-connectors/python/_command-create-tutorial.mdx" ;
21
+ import CommandCreateLambdaPythonNativeOperationHowTo from " @site/docs/data-modeling/partials/lambda-connectors/python/_command-create-native-operation-how-to.mdx" ;
20
22
import CommandCreateLambdaTypescript from " @site/docs/data-modeling/partials/lambda-connectors/typescript/_command-create-tutorial.mdx" ;
23
+ import CommandCreateLambdaTypescriptNativeOperationHowTo from " @site/docs/data-modeling/partials/lambda-connectors/typescript/_command-create-native-operation-how-to.mdx" ;
21
24
import CommandCreateMongoDB from " @site/docs/data-modeling/partials/classic-connectors/mongoDB/_command-create-tutorial.mdx" ;
22
- import CommandCreateMongoDBNativeMutationTutorial from " @site/docs/data-modeling/partials/classic-connectors/mongoDB/_command-create-native-mutation-tutorial .mdx" ;
23
- import CommandCreateMongoDBNativeMutationHowTo from " @site/docs/data-modeling/partials/classic-connectors/mongoDB/_command-create-native-mutation-how-to .mdx" ;
25
+ import CommandCreateMongoDBNativeOperationHowTo from " @site/docs/data-modeling/partials/classic-connectors/mongoDB/_command-create-native-operation-how-to .mdx" ;
26
+ import CommandCreateMongoDBNativeOperationTutorial from " @site/docs/data-modeling/partials/classic-connectors/mongoDB/_command-create-native-operation-tutorial .mdx" ;
24
27
import CommandCreatePostgreSQL from " @site/docs/data-modeling/partials/classic-connectors/postgreSQL/_command-create-tutorial.mdx" ;
25
- import CommandCreatePostgreSQLNativeMutationTutorial from " @site/docs/data-modeling/partials/classic-connectors/postgreSQL/_command-create-native-mutation-tutorial .mdx" ;
26
- import CommandCreatePostgreSQLNativeMutationHowTo from " @site/docs/data-modeling/partials/classic-connectors/postgreSQL/_command-create-native-mutation-how-to .mdx" ;
28
+ import CommandCreatePostgreSQLNativeOperationHowTo from " @site/docs/data-modeling/partials/classic-connectors/postgreSQL/_command-create-native-operation-how-to .mdx" ;
29
+ import CommandCreatePostgreSQLNativeOperationTutorial from " @site/docs/data-modeling/partials/classic-connectors/postgreSQL/_command-create-native-operation-tutorial .mdx" ;
27
30
import CommandUpdateClickHouse from " @site/docs/data-modeling/partials/classic-connectors/clickHouse/_command-update-tutorial.mdx" ;
28
31
import CommandUpdateLambdaGo from " @site/docs/data-modeling/partials/lambda-connectors/go/_command-update-tutorial.mdx" ;
29
32
import CommandUpdateLambdaPython from " @site/docs/data-modeling/partials/lambda-connectors/python/_command-update-tutorial.mdx" ;
@@ -36,7 +39,7 @@ import CommandUpdatePostgreSQL from "@site/docs/data-modeling/partials/classic-c
36
39
## Introduction
37
40
38
41
In DDN, commands represent operations in your API that can be executed such as those which modify data in your data
39
- sources, (inserts, updates, deletes), or custom business logic operations .
42
+ sources, (inserts, updates, deletes), or that perform complex read operations or execute custom business logic.
40
43
41
44
## Lifecycle
42
45
@@ -59,6 +62,9 @@ that point.
59
62
60
63
### From a source operation
61
64
65
+ Some data connectors support the ability to introspect your data source to discover the commands that can be added to
66
+ your supergraph automatically.
67
+
62
68
``` bash title="Introspect your data source:"
63
69
ddn connector introspect < connector_name>
64
70
```
@@ -79,17 +85,36 @@ ddn command add <connector_link_name> "*"
79
85
80
86
This will add commands with their accompanying metadata definitions to your metadata.
81
87
82
- ### Via native mutation { #via - native - mutation - how - to }
88
+ ### Via native operations { #via - native - operations - how - to }
89
+
90
+ Some data connectors support the ability to add commands via native operations so that you can add any operation that is
91
+ not supported by the automatic introspection process.
92
+
93
+ For classic database connectors, this will be native query code for that source. This can be, for example, a more
94
+ complex read operation or a way to run custom business logic, which can be exposed as queries or mutations in the
95
+ GraphQL API.
96
+
97
+ For Lambda connectors, eg: (TypeScript, Go, Python, etc) this will be a function (read-only) or procedure (mutation or
98
+ other side-effects) that can also be exposed as a query or mutation in the GraphQL API.
83
99
84
100
<Tabs groupId = " source-preference" className = " api-tabs" >
85
101
<TabItem value = " PostgreSQL" label = " PostgreSQL" >
86
- <CommandCreatePostgreSQLNativeMutationHowTo />
102
+ <CommandCreatePostgreSQLNativeOperationHowTo />
87
103
</TabItem >
88
104
<TabItem value = " MongoDB" label = " MongoDB" >
89
- <CommandCreateMongoDBNativeMutationHowTo />
105
+ <CommandCreateMongoDBNativeOperationHowTo />
90
106
</TabItem >
91
107
<TabItem value = " ClickHouse" label = " ClickHouse" >
92
- <CommandCreateClickHouseNativeMutationHowTo />
108
+ <CommandCreateClickHouseNativeOperationHowTo />
109
+ </TabItem >
110
+ <TabItem value = " TypeScript" label = " Node.js TypeScript" >
111
+ <CommandCreateLambdaTypescriptNativeOperationHowTo />
112
+ </TabItem >
113
+ <TabItem value = " Python" label = " Python" >
114
+ <CommandCreateLambdaPythonNativeOperationHowTo />
115
+ </TabItem >
116
+ <TabItem value = " Go" label = " Go" >
117
+ <CommandCreateLambdaGoNativeOperationHowTo />
93
118
</TabItem >
94
119
</Tabs >
95
120
@@ -146,28 +171,28 @@ To modify data, you first need to create a command that maps to a specific opera
146
171
<TabItem value = " ClickHouse" label = " ClickHouse" >
147
172
<CommandCreateClickHouse />
148
173
</TabItem >
149
- <TabItem value = " TypeScript" label = " Node.js TypeScript" >
150
- <CommandCreateLambdaTypescript />
151
- </TabItem >
152
- <TabItem value = " Python" label = " Python" >
153
- <CommandCreateLambdaPython />
154
- </TabItem >
155
- <TabItem value = " Go" label = " Go" >
156
- <CommandCreateLambdaGo />
157
- </TabItem >
158
174
</Tabs >
159
175
160
- #### Via native mutation { #via - native - mutation - tutorials }
176
+ #### Via native operations { #via - native - operation - tutorials }
161
177
162
178
<Tabs groupId = " source-preference" className = " api-tabs" >
163
179
<TabItem value = " PostgreSQL" label = " PostgreSQL" >
164
- <CommandCreatePostgreSQLNativeMutationTutorial />
180
+ <CommandCreatePostgreSQLNativeOperationTutorial />
165
181
</TabItem >
166
182
<TabItem value = " MongoDB" label = " MongoDB" >
167
- <CommandCreateMongoDBNativeMutationTutorial />
183
+ <CommandCreateMongoDBNativeOperationTutorial />
168
184
</TabItem >
169
185
<TabItem value = " ClickHouse" label = " ClickHouse" >
170
- <CommandCreateClickHouseNativeMutationTutorial />
186
+ <CommandCreateClickHouseNativeOperationTutorial />
187
+ </TabItem >
188
+ <TabItem value = " TypeScript" label = " Node.js TypeScript" >
189
+ <CommandCreateLambdaTypescript />
190
+ </TabItem >
191
+ <TabItem value = " Python" label = " Python" >
192
+ <CommandCreateLambdaPython />
193
+ </TabItem >
194
+ <TabItem value = " Go" label = " Go" >
195
+ <CommandCreateLambdaGo />
171
196
</TabItem >
172
197
</Tabs >
173
198
0 commit comments