Skip to content
/ gql-dyn Public

A proof of concept demonstrating how to build dynamic GraphQL schemas using Rust

License

Notifications You must be signed in to change notification settings

aleics/gql-dyn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gql-dyn

This is a proof of concept for building GraphQL schemas dynamically using juniper.

Start

To run the project, use cargo:

cargo run

This will spin up a graphiql client, which can be accessed in your browser at http://127.0.0.1:8080

Motivation

Generating a dynamic GraphQL API based on the user's context is an advanced use case, but useful in certain scenarios. There's not a clear path on how to implement this type of customization using juniper. Thus, I wanted to explore how/if it would be possible.

Approach

This repository demonstrates one possible approach by leveraging the existing GraphQLValue::TypeInfo to provide a custom configuration during type generation. This configuration specifies which types and fields are available, and these are used to generate the final GraphQL type dynamically.

About

A proof of concept demonstrating how to build dynamic GraphQL schemas using Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages