In this section, we'll learn how to implement a Query Operation using TypeScript. We'll create a
get operation that returns a user by its ID.
createOperation function and the
z object from the
wundergraph.factory module. It's important that the result of
createOperation is exported as the default export of the file.
The route of the operation is derived from the file path. In this case, the file is located at
.wundergraph/operations/users/get.ts, so the route of the operation is
Let's call this operation using curl:
The result should be: