{"id":22092347,"url":"https://github.com/bhoriuchi/graphql-go-tools","last_synced_at":"2025-10-20T08:34:35.745Z","repository":{"id":36348405,"uuid":"191678868","full_name":"bhoriuchi/graphql-go-tools","owner":"bhoriuchi","description":"Like apollo-tools for graphql-go","archived":false,"fork":false,"pushed_at":"2023-04-19T22:25:06.000Z","size":121,"stargazers_count":34,"open_issues_count":3,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T16:22:58.278Z","etag":null,"topics":["directives","go","golang","graphql","graphql-tools","makeexecutableschema","schema"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhoriuchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-13T02:45:16.000Z","updated_at":"2024-09-29T19:00:34.000Z","dependencies_parsed_at":"2024-06-18T18:22:32.834Z","dependency_job_id":"11546fe9-84cf-455f-91ad-7c29df3f46dc","html_url":"https://github.com/bhoriuchi/graphql-go-tools","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/bhoriuchi/graphql-go-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fgraphql-go-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fgraphql-go-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fgraphql-go-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fgraphql-go-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhoriuchi","download_url":"https://codeload.github.com/bhoriuchi/graphql-go-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhoriuchi%2Fgraphql-go-tools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262857279,"owners_count":23375492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["directives","go","golang","graphql","graphql-tools","makeexecutableschema","schema"],"created_at":"2024-12-01T03:09:14.445Z","updated_at":"2025-10-20T08:34:30.705Z","avatar_url":"https://github.com/bhoriuchi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-go-tools\nLike apollo-tools for graphql-go\n\n\n## Current Tools\n\n### `MakeExecutableSchema`\n\n**Currently supports:**\n\n  * Merge multiple graphql documents\n  * Object type extending\n  * Custom Directives\n  * Import types and directives\n\n**Planned:**\n\n  * Schema-stitching\n\n**Limitations:**\n\n  * Only types and directives defined in the `TypeDefs` with schema language can be extended and have custom directives applied.\n\n## Example\n\n```go\nfunc main() {\n  schema, err := tools.MakeExecutableSchema(tools.ExecutableSchema{\n    TypeDefs: `\n    directive @description(value: String!) on FIELD_DEFINITION\n\n    type Foo {\n      id: ID!\n      name: String!\n      description: String\n    }\n    \n    type Query {\n      foo(id: ID!): Foo @description(value: \"bazqux\")\n    }`,\n    Resolvers: tools.ResolverMap{\n      \"Query\": \u0026tools.ObjectResolver{\n        Fields: tools.FieldResolveMap{\n          \"foo\": \u0026tools.FieldResolver{\n            Resolve: func(p graphql.ResolveParams) (interface{}, error) {\n              // lookup data\n              return foo, nil\n            }\n          },\n        },\n      },\n    },\n    SchemaDirectives: tools.SchemaDirectiveVisitorMap{\n      \"description\": \u0026tools.SchemaDirectiveVisitor{\n        VisitFieldDefinition: func(field *graphql.Field, args map[string]interface{}) {\n          resolveFunc := field.Resolve\n          field.Resolve = func(p graphql.ResolveParams) (interface{}, error) {\n            result, err := resolveFunc(p)\n            if err != nil {\n              return result, err\n            }\n            data := result.(map[string]interface{})\n            data[\"description\"] = args[\"value\"]\n            return data, nil\n          }\n        },\n      },\n    },\n  })\n\n  if err != nil {\n    log.Fatalf(\"Failed to build schema, error: %v\", err)\n  }\n\n  params := graphql.Params{\n    Schema: schema,\n    RequestString: `\n    query GetFoo {\n      foo(id: \"5cffbf1ccecefcfff659cea8\") {\n        description\n      }\n    }`,\n  }\n\n  r := graphql.Do(params)\n  if r.HasErrors() {\n\t\tlog.Fatalf(\"failed to execute graphql operation, errors: %+v\", r.Errors)\n\t}\n\trJSON, _ := json.Marshal(r)\n\tfmt.Printf(\"%s \\n\", rJSON)\n}\n\n```\n\n### Handler\n\nModified `graphql-go/handler` with updated GraphiQL and Playground\n\nSee [handler package](handler)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhoriuchi%2Fgraphql-go-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhoriuchi%2Fgraphql-go-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhoriuchi%2Fgraphql-go-tools/lists"}