Skip to content

Commit

Permalink
docs: add AttrIsID
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarkk committed Oct 17, 2021
1 parent 4999b09 commit 293d1ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,21 @@ struct {
### Label as ID field

```go
struct {
struct Foo {
// Notice the "," before the id
Id string `gq:",id"`

// Pointers and numbers are also supported
// NOTE NUMBERS WILL BE CONVERTED TO STRINGS IN OUTPUT
PostId *int `gq:",id"`
}

// Label method response as ID using AttrIsID
// The value returned for AttrIsID is ignored
// You can also still just fine append an error: (string, AttrIsID, error)
func (Foo) ResolveExampleMethod() (string, AttrIsID) {
return "i'm an ID type", 0
}
```

### Methods and field arguments
Expand Down

0 comments on commit 293d1ec

Please sign in to comment.