graphql-go/graphql ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go library that lets me define a GraphQL schema and run queries, mutations, and subscriptions against it.

I want it to feel like the official GraphQL reference behavior, so it should support defining object types, scalars, enums, unions, interfaces, lists, non null fields, arguments, variables, fragments, directives, introspection, and validation errors that make sense. Please include a simple way to execute a request and get back JSON data plus errors, and make sure the common patterns are easy to use from a small Go app.

Also add a few clear examples, one basic hello world schema and a couple more realistic ones. If there are tricky parts, look up the current GraphQL docs online and follow the expected behavior. Keep the API clean and idiomatic for Go, and make sure the core package is covered by tests so it behaves predictably.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab