Documentation
¶
Overview ¶
Package graphql provides a lightweight GraphQL endpoint. It uses operation names and key field detection rather than a full AST engine, while still returning properly typed, DB-backed responses.
IMPORTANT: The gh CLI uses shurcooL-graphql which does STRICT unmarshaling. Extra fields in the response cause errors. All responses are filtered through filterResponse() to only include fields requested in the query.
Index ¶
- func DoTypeIntrospection(types map[string]string) map[string]any
- func EnumResp(names ...string) map[string]any
- func FieldResp(names ...string) map[string]any
- func FieldRespWithArgs(argsMap map[string][]string, names ...string) map[string]any
- func MergeInto(dst, src map[string]any)
- func MergeNestedData(dst, src map[string]any, key string)
- func TypeFields(typeName string) map[string]any
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoTypeIntrospection ¶
DoTypeIntrospection handles all __type introspection queries used by gh CLI for feature detection (IssueFeatures, PullRequestFeatures, etc.). types is a map of alias → type name extracted during parseQuery.
func FieldRespWithArgs ¶
FieldRespWithArgs builds a __type response where some fields have args.
func MergeInto ¶
MergeInto copies top-level keys from src's "data" map into dst's "data" map. Used to combine multiple query results (e.g. search + repository).
func MergeNestedData ¶
MergeNestedData merges nested data from src's "data.key" map into dst's "data.key" map.
func TypeFields ¶
TypeFields returns the introspection response for a given GraphQL type name. These match what GitHub's API returns so the CLI's feature detection works.
Types ¶
Source Files
¶
- filter.go
- gql_helpers.go
- gql_mut_dependabot.go
- gql_mut_git_database.go
- gql_mut_issue.go
- gql_mut_issue_comment.go
- gql_mut_milestone.go
- gql_mut_pr.go
- gql_mut_pr_review.go
- gql_mut_project.go
- gql_mut_project_field.go
- gql_mut_repo.go
- gql_mutations.go
- gql_queries.go
- gql_query_issue.go
- gql_query_pr.go
- gql_query_project.go
- gql_query_repo.go
- gql_query_repo_detail.go
- gql_shapes.go
- gql_shapes_dependabot.go
- gql_shapes_issue.go
- gql_shapes_pr.go
- gql_shapes_pr_status.go
- gql_shapes_project.go
- gql_shapes_repo.go
- gql_shapes_team.go
- handler.go
- handler_query.go