graphql

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

assembler/clients

This directory contains the GraphQL definition for the client-side of the "Refactoring the GUAC Assembler" project.

Note: This is still in experimental state and might change in the future!

Code outside of assembler/backends and assembler/graphql should not use structs defined in assembler/graphql directly as these should only be valid server side, being regenerated when the GraphQL schema changes.

Instead, code should use the structs defined here (or in similar other clients for utilities building on top of GUAC). These are generated based on the query documents that we want to send to the server.

GraphQL client configuration

  • genqlient.yaml: the configuration file for genqlient to generate Go code from GraphQL schema specification and the operation queries
  • operations/: the GraphQL queries that the client (e.g., GUAC) sends to the server (e.g., GUAC database backend, via GraphQL)
  • helpers/: the GraphQL helper functions to return an assembler function given a graphql client.

GraphQL client code generation

  • graphql.go: Mostly empty, contains load bearing comment to make sure Go code is generated by go generate ./... whenever schema/operations change
  • generated/: Contains code generated via go generate ./... to marshal a GraphQL query from Go structures and send it to the server. When the response is returned, the same code transforms the response into Go structures. This is based on what is included in operations/ and the GraphQL schema as defined at the time of last generation.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL