Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microBug at connections example #230

Closed
jekaspekas opened this issue Jul 27, 2018 · 0 comments
Closed

microBug at connections example #230

jekaspekas opened this issue Jul 27, 2018 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jekaspekas
Copy link
Contributor

Expected Behaviour

When using the "after" argument at friendsConnection query, the result list should be shifted.

Actual Behavior

The cursor values are shifted, but the result list always starts with the first value.

Minimal graphql.schema and models to reproduce

gqlgen/example/starwars/resolvers.go:

func (r *Resolver) FriendsConnection_edges(ctx context.Context, it *FriendsConnection) ([]FriendsEdge, error) {
	friends, err := r.resolveCharacters(ctx, it.ids)
	if err != nil {
		return nil, err
	}

	edges := make([]FriendsEdge, it.to-it.from)
	for i := range edges {
		edges[i] = FriendsEdge{
			Cursor: encodeCursor(it.from + i),
			Node:   friends[it.from + i],
		}
	}
	return edges, nil
}
`
@vektah vektah added bug Something isn't working good first issue Good for newcomers labels Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants