Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 3, 2022. It is now read-only.

Update for async-graphql v1.16.6 #4

Merged
atsuhiro merged 1 commit into atsuhiro:master from sunli829:master
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock
View file Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion codegen-for-async-graphql-example/Cargo.toml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ repository = "https://github.com/atsuhiro/codegen-for-async-graphql"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-graphql = "1.15.14"
async-graphql = "1.16.6"
async-std = { version = "1.5.0", features = ["attributes"] }
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ pub struct CreateFriendMutationPayload {}
#[Object]
impl CreateFriendMutationPayload {
pub async fn friend(&self, ctx: &Context<'_>) -> Friend {
ctx.data::<DataSource>().friend()
ctx.data_unchecked::<DataSource>().friend()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct FriendConnection {
#[Object]
impl FriendConnection {
pub async fn nodes(&self, ctx: &Context<'_>) -> Vec<Friend> {
ctx.data::<DataSource>().nodes()
ctx.data_unchecked::<DataSource>().nodes()
}
pub async fn total_count(&self) -> i32 {
self.total_count.clone()
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ pub struct Me {
#[Object]
impl Me {
pub async fn friends(&self, ctx: &Context<'_>, first: Option<i32>) -> FriendConnection {
ctx.data::<DataSource>().friends(first)
ctx.data_unchecked::<DataSource>().friends(first)
}
pub async fn notifications(&self, ctx: &Context<'_>) -> Option<Vec<Notification>> {
ctx.data::<DataSource>().notifications()
ctx.data_unchecked::<DataSource>().notifications()
}
pub async fn search(&self, ctx: &Context<'_>, text: String) -> Option<Vec<SearchResult>> {
ctx.data::<DataSource>().search(text)
ctx.data_unchecked::<DataSource>().search(text)
}
pub async fn id(&self) -> ID {
self.id.clone()
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct Query {
impl Query {
#[field(desc = "\"me: Single-line comment\"")]
pub async fn me(&self, ctx: &Context<'_>) -> Me {
ctx.data::<DataSource>().me()
ctx.data_unchecked::<DataSource>().me()
}
pub async fn active(&self) -> bool {
self.active.clone()
Expand Down
2 changes: 1 addition & 1 deletion codegen-for-async-graphql-renderer/Cargo.toml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = ["network-programming", "web-programming"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-graphql = "1.15.14"
async-graphql = "1.16.6"
async-graphql-parser = "1.14.2"
proc-macro2 = { version = "1.0", default-features = false }
quote = "1.0.7"
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Renderer {
quote!(
#field
pub async fn #n(&self, ctx: &Context<'_>, #arguments ) -> #ty {
ctx.data::<DataSource>().#n(#arguments_variebles)
ctx.data_unchecked::<DataSource>().#n(#arguments_variebles)
}
)
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /