-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove use of
juniper::graphql_object!
Fixes #55 This isn't complete yet. This patch currently removes support for having descriptions on field arguments. That is because getting those to work [requires funky stuff][funky] in the juniper proc macro invocation. While it could totally be made to work I would rather wait since it requires a bit of refactoring and since it should work seamlessly once [RFC 2564](rust-lang/rust#60406) is stable, which seems to happen in 1.39. [funky]: https://docs.rs/juniper_codegen/0.13.2/juniper_codegen/attr.object.html#customization-documentation-renaming-
- Loading branch information
1 parent
7a0fc43
commit 60735f8
Showing
3 changed files
with
102 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#![allow(dead_code, unused_variables, unused_must_use, unused_imports)] | ||
use juniper::{EmptyMutation, Executor, FieldResult, Variables}; | ||
use juniper_from_schema::{graphql_schema, graphql_schema_from_file}; | ||
|
||
pub struct Context; | ||
impl juniper::Context for Context {} | ||
|
||
fn main() {} | ||
|
||
graphql_schema! { | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
url: String! @juniper(ownership: "owned") | ||
} | ||
} | ||
|
||
pub struct Query; | ||
|
||
impl QueryFields for Query { | ||
fn field_url(&self, _: &Executor<'_, Context>) -> FieldResult<String> { | ||
Ok("".to_string()) | ||
} | ||
} |