Skip to content

Commit

Permalink
Add mutation to the gql sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Isurunc committed Sep 30, 2024
1 parent 2690a29 commit 4c49f6d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions graphql-service/sample.bal
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ service / on new graphql:Listener(8090) {
}
return "Hello, " + name;
}

remote function createUser(string name) returns string|error {
if name is "" {
return error("name should not be empty!");
}
return "User created with name: " + name;
}
}

0 comments on commit 4c49f6d

Please sign in to comment.