Skip to content

Commit

Permalink
MicroProfile GraphQL: Minor update to README and add missing @nonnull
Browse files Browse the repository at this point in the history
…on TaskApi (#3091)
  • Loading branch information
tmiddlet2666 authored Jun 9, 2021
1 parent 241d8aa commit cda45a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/microprofile/graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ Access the `/graphql` endpoint via `http://127.0.0.1:7001/graphql`:
```graphql
type Mutation {
"Create a task with the given description"
createTask(description: String): Task
createTask(description: String!): Task
"Remove all completed tasks and return the tasks left"
deleteCompletedTasks: [Task]
"Delete a task and return the deleted task details"
deleteTask(id: String): Task
deleteTask(id: String!): Task
"Update a task"
updateTask(completed: Boolean, description: String, id: String): Task
updateTask(completed: Boolean, description: String, id: String!): Task
}
type Query {
"Return a given task"
findTask(id: String): Task
findTask(id: String!): Task
"Query tasks and optionally specified only completed"
tasks(completed: Boolean): [Task]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TaskApi {
*/
@Mutation
@Description("Create a task with the given description")
public Task createTask(@Name("description") String description) {
public Task createTask(@Name("description") @NonNull String description) {
if (description == null) {
throw new IllegalArgumentException("Description must be provided");
}
Expand Down

0 comments on commit cda45a5

Please sign in to comment.