Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directive support #645

Open
obmarg opened this issue Apr 5, 2023 · 1 comment · May be fixed by #900
Open

Directive support #645

obmarg opened this issue Apr 5, 2023 · 1 comment · May be fixed by #900
Milestone

Comments

@obmarg
Copy link
Owner

obmarg commented Apr 5, 2023

The various derives (and probably the generator) should support passing directives in.

We should probably also offer first class support for the skip & include directives.

@obmarg
Copy link
Owner Author

obmarg commented May 7, 2023

Need to think about how to support each of the locations for directives in executables:

Field & FragmentSpread Positions

Field position seems relatively easy, can take a similar approach to arguments:

#[derive(QueryFragment)]
struct Whatever {
   #[directive(skipIf: $someVariable)]
   field: String

   #[cynic(spread)]
   #[directive(whatever: $xyz)]
   other: SomeFragment
}

Variable Definition

Similar for variable definitions

#[derive(QueryVariables)]
struct MyVariables {
   #[directive(whatever: 123)]
   variable: String
}

Fragment Definition

We don't currently support fragment definitions but this will need thought through if we decide to

Query & Mutation & Subscription Position

TBC

Inline Fragment

TBC

@obmarg obmarg added this to the 4.0.0 milestone Apr 7, 2024
@obmarg obmarg linked a pull request Apr 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant