Skip to content

Commit b07b6f2

Browse files
committed
fix: first value id should be 1
Signed-off-by: Christian Stewart <[email protected]>
1 parent 90dafe4 commit b07b6f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

directive/controller/instance.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type directiveInstance struct {
5151
// res contains attached resolvers
5252
res []*resolver
5353
// valCtr is the ID of the next value
54+
// note: the first value ID is 1, not 0
5455
valCtr uint32
5556
// runningResolvers is the number of running resolvers.
5657
runningResolvers int
@@ -266,8 +267,8 @@ func (i *directiveInstance) addValueLocked(res *resolver, val directive.Value) (
266267
return 0, false
267268
}
268269

269-
vid := i.valCtr
270270
i.valCtr++
271+
vid := i.valCtr
271272
v := &value{id: vid, val: val}
272273
res.vals = append(res.vals, v)
273274

0 commit comments

Comments
 (0)