MCPcopy Index your code
hub / github.com/github/github-mcp-server / ToGraphQLParams

Method ToGraphQLParams

pkg/github/params.go:455–473  ·  view source on GitHub ↗

ToGraphQLParams converts cursor pagination parameters to GraphQL-specific parameters.

()

Source from the content-addressed store, hash-verified

453
454// ToGraphQLParams converts cursor pagination parameters to GraphQL-specific parameters.
455func (p CursorPaginationParams) ToGraphQLParams() (*GraphQLPaginationParams, error) {
456 if p.PerPage > 100 {
457 return nil, fmt.Errorf("perPage value %d exceeds maximum of 100", p.PerPage)
458 }
459 if p.PerPage < 0 {
460 return nil, fmt.Errorf("perPage value %d cannot be negative", p.PerPage)
461 }
462 first := int32(p.PerPage)
463
464 var after *string
465 if p.After != "" {
466 after = &p.After
467 }
468
469 return &GraphQLPaginationParams{
470 First: &first,
471 After: after,
472 }, nil
473}
474
475type GraphQLPaginationParams struct {
476 First *int32

Callers 1

ToGraphQLParamsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected