Skip to content

Conversation

MarcoFuykschot
Copy link

modified:   juniper/src/lib.rs
modified:   juniper/src/schema/model.rs

(feat) create schema with custom directives

First change for #156

@tyranron tyranron added k::api Related to API (application interface) feature New feature or request labels May 2, 2025
Copy link
Member

@tyranron tyranron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoFuykschot

First change for #156

Could you provide some grand vision/description of how it's supposed to work? And what would be the next steps?

From the provided example in the code and PR description, it's not very clear.

@MarcoFuykschot
Copy link
Author

@MarcoFuykschot

First change for #156

Could you provide some grand vision/description of how it's supposed to work? And what would be the next steps?

From the provided example in the code and PR description, it's not very clear.

Step 1: is allow custom directives, added to a schema to pass validation.
Step 2: Update graphql parser to support directive definitions
Step 3: Create a mechanisme for user code to react on directives during execution.

	modified:   juniper/src/schema/model.rs#
    modified:   juniper/src/schema/translate/graphql_parser.rs

Added new function to create a schema with custom directives
Added doctest
Added directives to be included in the schema output
@tyranron
Copy link
Member

tyranron commented May 9, 2025

@MarcoFuykschot

Step 3: Create a mechanisme for user code to react on directives during execution.

Could you sketch your vision of API?

@MarcoFuykschot
Copy link
Author

For the api, i have two idea's

  1. A visitor like pattern, on the the incoming query,
  2. Add a context like object as paramter to the fields.

Both i still need to reseach the code, on how to implement this in a non breaking way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request k::api Related to API (application interface)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants