🎬 That's a Wrap for GraphQLConf 2024! • Watch the Videos • Check out the recorded talks and workshops

Code Using GraphQL

Sort by:
GraphiQL
An interactive in-browser GraphQL IDE.
Last release 1 month ago16kMIT License
Postgraphile
builds a powerful, extensible and performant GraphQL API from a PostgreSQL schema in seconds; saving you weeks if not months of development time.
Last release 1 year ago13kOther
quicktype
Generate types for GraphQL queries in TypeScript, Swift, golang, C#, C++, and more.
12kApache License 2.0
GraphQL Code Generator
GraphQL code generator with flexible support for custom plugins and templates like Typescript (frontend and backend), React Hooks, resolvers signatures and more.
Last release 3 days ago11kMIT License
GraphQL Code Generator
GraphQL code generator with flexible support for custom plugins and templates like Typescript (frontend and backend), React Hooks, resolvers signatures and more.
Last release 3 days ago11kMIT License
GraphQL Tools
A set of utils for faster development of GraphQL tools (Schema and documents loading, Schema merging and more).
Last release 2 weeks ago5kMIT License
GraphQLShield
A GraphQL tool to ease the creation of permission layer.
Last release 1 year ago4kMIT License
README

GraphQL Shield helps you create a permission layer for your application. Using an intuitive rule-API, you’ll gain the power of the shield engine on every request and reduce the load time of every request with smart caching. This way you can make sure your application will remain quick, and no internal data will be exposed.

import { rule, shield, and, or, not } from "graphql-shield"
 
// Rules
 
const isAuthenticated = rule({ cache: "contextual" })(async (
  parent,
  args,
  ctx,
  info,
) => {
  return ctx.user !== null
})
 
const isAdmin = rule({ cache: "contextual" })(async (
  parent,
  args,
  ctx,
  info,
) => {
  return ctx.user.role === "admin"
})
 
const isEditor = rule({ cache: "contextual" })(async (
  parent,
  args,
  ctx,
  info,
) => {
  return ctx.user.role === "editor"
})
 
// Permissions
 
const permissions = shield({
  Query: {
    frontPage: not(isAuthenticated),
    fruits: and(isAuthenticated, or(isAdmin, isEditor)),
    customers: and(isAuthenticated, isAdmin),
  },
  Mutation: {
    addFruitToBasket: isAuthenticated,
  },
  Fruit: isAuthenticated,
  Customer: isAdmin,
})
 
// Server
 
const server = new GraphQLServer({
  typeDefs,
  resolvers,
  middlewares: [permissions],
  context: req => ({
    ...req,
    user: getUser(req),
  }),
})
GraphQL Mesh
GraphQL Mesh allows you to use GraphQL query language to access data in remote APIs that don't run GraphQL (and also ones that do run GraphQL). It can be used as a gateway to other services, or run as a local GraphQL schema that aggregates data from remote APIs.
Last release 1 week ago3kMIT License
graphjin
An instant GraphQL to SQL compiler. Use as a standalone service or a Go library. Formerly super-graph.
Last release 2 months ago3kApache License 2.0
GiraphQL
A plugin based schema builder for creating code-first GraphQL schemas in typescript
Last release 1 day ago2kISC License
README

GiraphQL makes writing type-safe schemas simple, and works without a code generator, build process, or extensive manual type definitions.

import { ApolloServer } from "apollo-server"
import SchemaBuilder from "@giraphql/core"
 
const builder = new SchemaBuilder({})
 
builder.queryType({
  fields: t => ({
    hello: t.string({
      args: {
        name: t.arg.string({}),
      },
      resolve: (parent, { name }) => `hello, ${name || "World"}`,
    }),
  }),
})
 
new ApolloServer({
  schema: builder.toSchema({}),
}).listen(3000)
WunderGraph
WunderGraph is an open-source GraphQL Gateway that is able to compose Apollo Federation, GraphQL, REST APIs, Databases, Kafka and more.
Last release 4 months ago2kApache License 2.0
README

WunderGraph composes all your APIs into a single unified GraphQL API and allows you to expose your Graph as a secure and type-safe JSON-RPC API.

To get started with WunderGraph, you can use create-wundergraph-app to bootstrap a new project:

npx create-wundergraph-app my-project -E nextjs-swr

On the client side, WunderGraph’s JSON-RPC API integrates very well with frameworks like Next.js, SWR and React Query, while one the backend, we’re able to leverage the power of “Server-Side-Only GraphQL”. Handle authentication, authorization, validation, joins and more right in the Query Layer.

mutation (
  $name: String! @fromClaim(name: NAME)
  $email: String! @fromClaim(name: EMAIL)
  $message: String! @jsonSchema(pattern: "^[a-zA-Z 0-9]+$")
) {
  createOnepost(
    data: {
      message: $message
      user: {
        connectOrCreate: {
          where: { email: $email }
          create: { email: $email, name: $name }
        }
      }
    }
  ) {
    id
    message
    user {
      id
      name
    }
  }
}

The Query above requires the user to be authenticated, injects the user’s name and email from the JWT token and validates the message against a JSON Schema.

Here’s another example showcasing how we can use Server-Side GraphQL with WunderGraph’s unique join capabilities, composing data from two different APIs into a single GraphQL response.

query (
  $continent: String!
  # the @internal directive removes the $capital variable from the public API
  # this means, the user can't set it manually
  # this variable is our JOIN key
  $capital: String! @internal
) {
  countries_countries(filter: { continent: { eq: $continent } }) {
    code
    name
    # using the @export directive, we can export the value of the field `capital` into the JOIN key ($capital)
    capital @export(as: "capital")
    # the _join field returns the type Query!
    # it exists on every object type so you can everywhere in your Query documents
    _join {
      # once we're inside the _join field, we can use the $capital variable to join the weather API
      weather_getCityByName(name: $capital) {
        weather {
          temperature {
            max
          }
          summary {
            title
            description
          }
        }
      }
    }
  }
}

The full example can be found on GitHub.

Schemathesis
A modern API testing tool for web applications built with Open API and GraphQL specifications.
Last release 1 day ago2kMIT License
README

Run Schemathesis via Docker against your GraphQL endpoint:

docker run schemathesis/schemathesis \
  run https://your.app.com/graphql

Schemathesis will generate queries matching your GraphQL schema and catch server crashes automatically. Generated queries have arbitrary depth and may contain any subset of GraphQL types defined in the input schema. They expose edge cases in your code that are unlikely to be found otherwise.

Note that you can write your app in any programming language; the tool will communicate with it over HTTP.

For example, running the command above against https://bahnql.herokuapp.com/graphql uncovers that running the { search(searchTerm: "") { stations { name } } } query leads to a server error:

{
  "errors": [
    {
      "message": "Cannot read property 'city' of undefined",
      "locations": [
        {
          "line": 1,
          "column": 28
        }
      ],
      "path": ["search", "stations"]
    }
  ],
  "data": null
}
GraphQL CLI
A command line tool for common GraphQL development workflows.
Last release 4 years ago2kMIT License
GraphQL Scalars
A library of custom GraphQL scalar types for creating precise, type-safe GraphQL schemas.
Last release 6 months ago2kMIT License
GraphQL Inspector
Compare schemas, validate documents, find breaking changes, find similar types, schema coverage, and more.
Last release 4 months ago2kMIT License
Microcks
Open source Kubernetes-native tool for API Mocking and Testing
Last release 12 hours ago1kApache License 2.0
README

Microcks is a platform for turning your API and microservices assets - GraphQL schemas, OpenAPI specs, AsyncAPI specs, gRPC protobuf, Postman collections, SoapUI projects_ - into live simulations in seconds.

It also reuses these assets for running compliance and non-regression tests against your API implementation. We provide integrations with Jenkins, GitHub Actions, Tekton and many others through a simple CLI.

GraphQL Modules
GraphQL Modules lets you separate your backend implementation to small, reusable, easy-to-implement and easy-to-test pieces.
Last release 11 months ago1kMIT License
GraphQL Config
One configuration for all your GraphQL tools (supported by most tools, editors & IDEs).
Last release 1 day ago1kMIT License
GraphQL Middleware
Split up your GraphQL resolvers in middleware functions.
Last release 1 year ago1kMIT License
README

GraphQL Middleware is a schema wrapper which allows you to manage additional functionality across multiple resolvers efficiently.

Features

💡 Easy to use: An intuitive, yet familiar API that you will pick up in a second. 💪 Powerful: Allows complete control over your resolvers (Before, After). 🌈 Compatible: Works with any GraphQL Schema.

Example

const { ApolloServer } = require("apollo-server")
const { makeExecutableSchema } = require("@graphql-tools/schema")
 
const typeDefs = `
type Query {
  hello(name: String): String
  bye(name: String): String
}
`
const resolvers = {
  Query: {
    hello: (root, args, context, info) => {
      console.log(`3. resolver: hello`)
      return `Hello ${args.name ? args.name : "world"}!`
    },
    bye: (root, args, context, info) => {
      console.log(`3. resolver: bye`)
      return `Bye ${args.name ? args.name : "world"}!`
    },
  },
}
 
const logInput = async (resolve, root, args, context, info) => {
  console.log(`1. logInput: ${JSON.stringify(args)}`)
  const result = await resolve(root, args, context, info)
  console.log(`5. logInput`)
  return result
}
 
const logResult = async (resolve, root, args, context, info) => {
  console.log(`2. logResult`)
  const result = await resolve(root, args, context, info)
  console.log(`4. logResult: ${JSON.stringify(result)}`)
  return result
}
 
const schema = makeExecutableSchema({ typeDefs, resolvers })
 
const schemaWithMiddleware = applyMiddleware(schema, logInput, logResult)
 
const server = new ApolloServer({
  schema: schemaWithMiddleware,
})
 
await server.listen({ port: 8008 })
SpectaQL
SpectaQL generates static HTML documentation from a GraphQL schema.
1kMIT License
README

SpectaQL is a Node.js library that generates static documentation for a GraphQL schema using a variety of options:

  • From a live endpoint using the introspection query.
  • From a file containing an introspection query result.
  • From a file, files or glob leading to the schema definitions in SDL.

Out of the box, SpectaQL generates a single 3-column HTML page and lets you choose between a couple built-in themes. A main goal of the project is to be easily and extremely customizable—it is themeable and just about everything can be overridden or customized.

npm install --dev spectaql
# OR
yarn add -D spectaql
 
# Then generate your docs
npm run spectaql my-config.yml
# OR
yarn spectaql my-config.yml
libgraphqlparser
A GraphQL query language parser in C++ with C and C++ APIs.
Last release 6 years ago1kMIT License
SOFA
Generate REST API from your GraphQL API.
Last release 9 months ago1kMIT License
GraphQL-ESLint
GraphQL-ESLint integrates GraphQL AST in the ESLint core (as a parser).
Last release 1 day ago1kMIT License
GraphQL Armor
The missing GraphQL security layer for Apollo GraphQL and Yoga / Envelop servers.
Last release 3 months ago494MIT License
gqt
Build and execute GraphQL queries in the terminal.
464MIT License
README

Run gqt against your GraphQL endpoint. Build your query in an intuitive TUI and execute it. The response from the server is written to standard output.

gqt -e https://your.app.com/graphql
GraphQL Live Query
Real-Time with GraphQL for any GraphQL schema or transport.
Last release 2 years ago437MIT License
GraphQL Language Service
An interface for building GraphQL language services for IDEs (diagnostics, autocomplete etc).
420Unknown
GraphQL-HTTP
Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite.
Last release 6 months ago304MIT License
GraphQL Java Generator
GraphQL Java Generator is a tool that generates Java code to speed up development for Client and Server of GraphQL APIs
54MIT License
README
  • GraphQL Java client: it generates the Java classes that call the GraphQL endpoint, and the POJO that will contain the data returned by the server. The GraphQL endpoint can then be queried by using a simple call to a Java method (see sample below)
  • GraphQL Java server: it is based on graphql-java (listed here above). It generates all the boilerplate code. You’ll only have to implement what’s specific to your server, which are the joins between the GraphQL types. GraphQL Java Generator is available as a Maven Plugin. A Gradle plugin is coming soon. Please note that GraphQL Java Generator is an accelerator: the generated code doesn’t depend on any library specific to GraphQL Java Generator. So, it helps you to start building application based on graphql-java. Once the code is generated, you can decide to manually edit it as any standard java application, and get rid of GraphQL Java Generator. Of course you can, and should, according to us :), continue using GraphQL Java Generator when your project evolves.
Microfiber
A library to query and manipulate GraphQL Introspection Query results.
32MIT License
README

Microfiber is a JavaScript library that allows:

  • Digging through your Introspection Query Results for a specific Query, Mutation, Type, Field, Argument or Subscription.
  • Removing a specific Query, Mutation, Type, Field/InputField, Argument or Subscription from your Introspection Query Results.
  • Removing Queries, Mutations, Fields/InputFields or Arguments that refer to Type that does not exist in - or has been removed from - your Introspection Query Results.
npm install microfiber
# OR
yarn add microfiber

Then in JS:

import { Microfiber } from "microfiber"
 
const introspectionQueryResults = {
  // ...
}
 
const microfiber = new Microfiber(introspectionQueryResults)
 
// ...do some things to your schema with `microfiber`
 
const cleanedIntrospectonQueryResults = microfiber.getResponse()
Brangr
Browse Any Graph - A user-friendly viewer for any GraphQL service
Last release 1 year ago2Mozilla Public License 2.0
README

Brangr - Browse Any Graph

  • Brangr is a simple, unique tool that any web server can host to provide a user-friendly browser/viewer for any GraphQL service (or many).

  • Brangr formats GraphQL results attractively, via a selection of user-configurable layouts. It lets users extract the generated HTML, and its source JSON. It provides a clever schema browser. It has built-in docs.

  • Brangr enables sites hosting it to present users with a collection of pre-fab GraphQL requests, which they can edit if desired, and let them create their own requests. And it allows sites to define custom CSS styling for all aspects of the formatted results.

  • Try it at the public Brangr site.

Example

query {
  heroes(_layout: { type: table }) { # _layout arg not sent to service
    first
    last
  }
}

Brangr renders the above query as follows (though not in a quote block):

heroes...
First Last
ArthurDent
Ford Prefect
ZaphodBeeblebrox