Movatterモバイル変換


[0]ホーム

URL:


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

Commit866ab52

Browse files
committed
Merge branch 'master' into release
2 parents90e12ee +dba4342 commit866ab52

File tree

213 files changed

+1402
-771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+1402
-771
lines changed

‎.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
fail-fast:false
5050
matrix:
5151
include:
52-
-{ rust: 1.83.0, os: ubuntu-22.04 }
52+
-{ rust: 1.86.0, os: ubuntu-22.04 }
5353
steps:
5454
-name:Checkout
5555
uses:actions/checkout@v4
@@ -82,7 +82,7 @@ jobs:
8282
fail-fast:false
8383
matrix:
8484
include:
85-
-{ rust: nightly-2023-09-07, os: ubuntu-22.04 }
85+
-{ rust: nightly-2025-04-09, os: ubuntu-22.04 }
8686
steps:
8787
-name:Checkout
8888
uses:actions/checkout@v4
@@ -132,7 +132,7 @@ jobs:
132132
-name:Install mdBook
133133
uses:peaceiris/actions-mdbook@v1
134134
with:
135-
mdbook-version:"0.4.37"
135+
mdbook-version:"0.4.49"
136136
-name:Extract metadata
137137
id:meta
138138
run:|

‎.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
-name:Install stable toolchain
1616
uses:dtolnay/rust-toolchain@stable
1717
with:
18-
toolchain:1.83.0
18+
toolchain:1.86.0
1919
-name:Rust Cache
2020
uses:Swatinem/rust-cache@v2
2121
-name:Install cargo-llvm-cov

‎.rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
edition ="2021"
1+
edition ="2024"
22
newline_style ="Unix"
33
# comments
44
normalize_comments =true

‎CHANGELOG.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on[Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
#[7.0.17] 2025-05-24
8+
9+
- update MSRV to`1.86.0`
10+
- Allow exporting SDL with spaces[#1688](https://github.com/async-graphql/async-graphql/pull/1688)
11+
- Update GraphiQLSource to use React v18[#1705](https://github.com/async-graphql/async-graphql/pull/1705)
12+
- fix: generate description of directives.[#1681](https://github.com/async-graphql/async-graphql/pull/1681)
13+
- feat: add@requiresScopes support[#1695](https://github.com/async-graphql/async-graphql/pull/1695)
14+
- chore: fix clippy and fmt errors[#1713](https://github.com/async-graphql/async-graphql/pull/1713)
15+
- use preferred mime-type[#1714](https://github.com/async-graphql/async-graphql/pull/1714)
16+
- Add GraphiQLSource version[#1704](https://github.com/async-graphql/async-graphql/pull/1704)
17+
718
#[7.0.16] 2025-03-20
819

920
- dynamic: fixed`__typename` always returned`null` when introspection was disabled.
@@ -110,7 +121,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
110121

111122
#[7.0.2] 2024-02-18
112123

113-
- Fix`#[derive(OneofObject)]` rejecting enums where the type comes from a macrosubsitution[#1473](https://github.com/async-graphql/async-graphql/pull/1473)
124+
- Fix`#[derive(OneofObject)]` rejecting enums where the type comes from a macrosubstitution[#1473](https://github.com/async-graphql/async-graphql/pull/1473)
114125
- Optimize object proc-macro codegen[#1470](https://github.com/async-graphql/async-graphql/pull/1470)
115126
- Use`impl Future` instead of`async-trait` in most traits.[#1468](https://github.com/async-graphql/async-graphql/pull/1468)
116127
- Upgrade`base64` to`0.21`[#1466](https://github.com/async-graphql/async-graphql/pull/1466)
@@ -182,7 +193,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
182193

183194
#[6.0.1] 2023-08-02
184195

185-
- dynamic: remove`TypeRefInnner`
196+
- dynamic: remove`TypeRefInner`
186197
- update MSRV to`1.67.0`
187198

188199
#[6.0.0] 2023-07-29
@@ -267,7 +278,7 @@ pub fn lowercase() -> impl CustomDirective {
267278
- dynamic schema: add boxed_any function[#1179](https://github.com/async-graphql/async-graphql/pull/1179)
268279
- Improve GraphiQL v2[#1182](https://github.com/async-graphql/async-graphql/pull/1182)
269280
- Fix:__Type.oneOf to__Type.isOneOf[#1188](https://github.com/async-graphql/async-graphql/pull/1188)
270-
-Implemente From<ID> for ConstValue[#1169](https://github.com/async-graphql/async-graphql/pull/1169)
281+
-Implement From<ID> for ConstValue[#1169](https://github.com/async-graphql/async-graphql/pull/1169)
271282
- Fixes[#1192](https://github.com/async-graphql/async-graphql/issues/1192)
272283

273284
#[5.0.4] 2022-12-17
@@ -410,7 +421,7 @@ pub fn lowercase() -> impl CustomDirective {
410421
#[4.0.3] 2022-6-20
411422

412423
- Custom error type in axum request extractor[#945](https://github.com/async-graphql/async-graphql/pull/945)
413-
- Add nodes exposure on`ConectionType` so nesting through edges isn't always needed.[#952](https://github.com/async-graphql/async-graphql/pull/952)
424+
- Add nodes exposure on`ConnectionType` so nesting through edges isn't always needed.[#952](https://github.com/async-graphql/async-graphql/pull/952)
414425
- Make email-validator optional[#950](https://github.com/async-graphql/async-graphql/pull/950)
415426

416427
#[4.0.2] 2022-6-10

‎Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
33
categories = ["network-programming","asynchronous"]
44
description ="A GraphQL server library implemented in Rust"
55
documentation ="https://docs.rs/async-graphql/"
6-
edition ="2021"
7-
rust-version ="1.83.0"
6+
edition ="2024"
7+
rust-version ="1.86.0"
88
homepage ="https://github.com/async-graphql/async-graphql"
99
keywords = ["futures","async","graphql"]
1010
license ="MIT OR Apache-2.0"
1111
name ="async-graphql"
1212
readme ="README.md"
1313
repository ="https://github.com/async-graphql/async-graphql"
14-
version ="7.0.16"
14+
version ="7.0.17"
1515

1616
[features]
1717
apollo_persisted_queries = ["lru","sha2"]
@@ -147,10 +147,10 @@ members = [
147147
]
148148

149149
[workspace.dependencies]
150-
async-graphql = {path =".",version ="7.0.16",default-features =false }
151-
async-graphql-derive = {path ="derive",version ="7.0.16" }
152-
async-graphql-parser = {path ="parser",version ="7.0.16" }
153-
async-graphql-value = {path ="value",version ="7.0.16" }
150+
async-graphql = {path =".",version ="7.0.17",default-features =false }
151+
async-graphql-derive = {path ="derive",version ="7.0.17" }
152+
async-graphql-parser = {path ="parser",version ="7.0.17" }
153+
async-graphql-value = {path ="value",version ="7.0.17" }
154154

155155
serde = {version ="1.0.197",features = ["derive"] }
156156
serde_json ="1.0.115"

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ I strongly recommend limiting the [complexity and depth](https://async-graphql.g
124124
- Apollo Tracing extension
125125
- Apollo Federation(v2)
126126

127-
>**Note**: Minimum supported Rust version: 1.83.0 or later
127+
>**Note**: Minimum supported Rust version: 1.86.0 or later
128128
129129
##Examples
130130

@@ -186,7 +186,7 @@ This crate offers the following features. Most are not activated by default, exc
186186
###Observability
187187

188188
One of the tools used to monitor your graphql server in production is Apollo Studio. Apollo Studio is a cloud platform that helps you build, monitor, validate, and secure your organization's data graph.
189-
Add the extension crate[`async_graphql_apollo_studio_extension`](https://github.com/async-graphql/async_graphql_apollo_studio_extension) to make thisavaliable.
189+
Add the extension crate[`async_graphql_apollo_studio_extension`](https://github.com/async-graphql/async_graphql_apollo_studio_extension) to make thisavailable.
190190

191191
##Who's using`async-graphql` in production?
192192

‎benches/static_schema.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use std::collections::HashMap;
22

33
use async_graphql::{
4-
connection::{query,Connection,Edge},
5-
Context,Enum,Error,Interface,Object,OutputType,Result,*,
4+
Context,Enum,Error,Interface,Object,OutputType,Result,
5+
connection::{Connection,Edge, query},
6+
*,
67
};
7-
use criterion::{criterion_group, criterion_main,Criterion};
8+
use criterion::{Criterion, criterion_group, criterion_main};
89
use slab::Slab;
910

1011
pubstructStarWarsChar{
@@ -174,7 +175,7 @@ pub struct Human<'a>(&'a StarWarsChar);
174175

175176
/// A humanoid creature in the Star Wars universe.
176177
#[Object]
177-
impl<'a>Human<'a>{
178+
implHuman<'_>{
178179
/// The id of the human.
179180
asyncfnid(&self) ->&str{
180181
self.0.id
@@ -216,7 +217,7 @@ pub struct Droid<'a>(&'a StarWarsChar);
216217

217218
/// A mechanical creature in the Star Wars universe.
218219
#[Object]
219-
impl<'a>Droid<'a>{
220+
implDroid<'_>{
220221
/// The id of the droid.
221222
asyncfnid(&self) ->&str{
222223
self.0.id

‎derive/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
33
categories = ["network-programming","asynchronous"]
44
description ="Macros for async-graphql"
55
documentation ="https://docs.rs/async-graphql/"
6-
edition ="2021"
6+
edition ="2024"
77
homepage ="https://github.com/async-graphql/async-graphql"
88
keywords = ["futures","async","graphql"]
99
license ="MIT OR Apache-2.0"
1010
name ="async-graphql-derive"
1111
repository ="https://github.com/async-graphql/async-graphql"
12-
version ="7.0.16"
12+
version ="7.0.17"
1313

1414
[lib]
1515
proc-macro =true

‎derive/src/args.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![allow(dead_code)]
22

33
use darling::{
4+
FromDeriveInput,FromField,FromMeta,FromVariant,
45
ast::{Data,Fields,NestedMeta},
56
util::{Ignored,SpannedValue},
6-
FromDeriveInput,FromField,FromMeta,FromVariant,
77
};
88
use inflector::Inflector;
99
use quote::format_ident;
@@ -235,6 +235,8 @@ pub struct SimpleObjectField {
235235
#[darling(default, multiple, rename ="directive")]
236236
pubdirectives:Vec<Expr>,
237237
pubcomplexity:Option<Expr>,
238+
#[darling(default, multiple)]
239+
pubrequires_scopes:Vec<String>,
238240
}
239241

240242
#[derive(FromDeriveInput)]
@@ -286,6 +288,8 @@ pub struct SimpleObject {
286288
pubguard:Option<Expr>,
287289
#[darling(default, multiple, rename ="directive")]
288290
pubdirectives:Vec<Expr>,
291+
#[darling(default, multiple)]
292+
pubrequires_scopes:Vec<String>,
289293
}
290294

291295
#[derive(FromMeta,Default)]
@@ -335,6 +339,8 @@ pub struct Object {
335339
pubguard:Option<Expr>,
336340
#[darling(default, multiple, rename ="directive")]
337341
pubdirectives:Vec<Expr>,
342+
#[darling(default, multiple)]
343+
pubrequires_scopes:Vec<String>,
338344
}
339345

340346
#[derive(FromMeta,Default)]
@@ -361,6 +367,8 @@ pub struct ObjectField {
361367
pubflatten:bool,
362368
#[darling(default, multiple, rename ="directive")]
363369
pubdirectives:Vec<Expr>,
370+
#[darling(default, multiple)]
371+
pubrequires_scopes:Vec<String>,
364372
}
365373

366374
#[derive(FromMeta,Default,Clone)]
@@ -402,6 +410,8 @@ pub struct Enum {
402410
pubtags:Vec<String>,
403411
#[darling(default, multiple, rename ="directive")]
404412
pubdirectives:Vec<Expr>,
413+
#[darling(default, multiple)]
414+
pubrequires_scopes:Vec<String>,
405415
}
406416

407417
#[derive(FromVariant)]
@@ -656,6 +666,8 @@ pub struct InterfaceField {
656666
puboverride_from:Option<String>,
657667
#[darling(default, multiple, rename ="directive")]
658668
pubdirectives:Vec<Expr>,
669+
#[darling(default, multiple)]
670+
pubrequires_scopes:Vec<String>,
659671
}
660672

661673
#[derive(FromVariant)]
@@ -697,6 +709,8 @@ pub struct Interface {
697709
// for OneofObject
698710
#[darling(default)]
699711
pubinput_name:Option<String>,
712+
#[darling(default, multiple)]
713+
pubrequires_scopes:Vec<String>,
700714
}
701715

702716
#[derive(FromMeta,Default)]
@@ -712,6 +726,8 @@ pub struct Scalar {
712726
#[darling(multiple, rename ="tag")]
713727
pubtags:Vec<String>,
714728
pubspecified_by_url:Option<String>,
729+
#[darling(default, multiple)]
730+
pubrequires_scopes:Vec<String>,
715731
}
716732

717733
#[derive(FromMeta,Default)]
@@ -982,6 +998,8 @@ pub struct ComplexObjectField {
982998
pubflatten:bool,
983999
#[darling(default, multiple, rename ="directive")]
9841000
pubdirectives:Vec<Expr>,
1001+
#[darling(default, multiple)]
1002+
pubrequires_scopes:Vec<String>,
9851003
}
9861004

9871005
#[derive(FromMeta,Default)]

‎derive/src/complex_object.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ use proc_macro::TokenStream;
44
use proc_macro2::Ident;
55
use quote::quote;
66
use syn::{
7-
ext::IdentExt, punctuated::Punctuated,Block,Error,FnArg,ImplItem,ItemImpl,Pat,
8-
ReturnType,Token,Type,TypeReference,
7+
Block,Error,FnArg,ImplItem,ItemImpl,Pat,ReturnType,Token,Type,TypeReference,
8+
ext::IdentExt, punctuated::Punctuated,
99
};
1010

1111
usecrate::{
1212
args::{self,RenameRuleExt,RenameTarget,TypeDirectiveLocation},
1313
output_type::OutputType,
1414
utils::{
15-
extract_input_args, gen_boxed_trait, gen_deprecation, gen_directive_calls,
15+
GeneratorResult,extract_input_args, gen_boxed_trait, gen_deprecation, gen_directive_calls,
1616
generate_default, generate_guards, get_cfg_attrs, get_crate_name, get_rustdoc,
1717
get_type_path_and_name, parse_complexity_expr, parse_graphql_attrs, remove_graphql_attrs,
18-
visible_fn,GeneratorResult,
18+
visible_fn,
1919
},
2020
};
2121

@@ -32,7 +32,7 @@ pub fn generate(
3232
letmut resolvers =Vec::new();
3333
letmut schema_fields =Vec::new();
3434

35-
// Computation of thederivated fields
35+
// Computation of thederived fields
3636
letmut derived_impls =vec![];
3737
for itemin&mut item_impl.items{
3838
ifletImplItem::Fn(method) = item{
@@ -138,7 +138,7 @@ pub fn generate(
138138
&method.sig.output,
139139
"Flatten resolver must have a return type",
140140
)
141-
.into())
141+
.into());
142142
}
143143
};
144144
let ty = ty.value_type();
@@ -191,6 +191,11 @@ pub fn generate(
191191
.iter()
192192
.map(|tag|quote!(::std::string::ToString::to_string(#tag)))
193193
.collect::<Vec<_>>();
194+
let requires_scopes = method_args
195+
.requires_scopes
196+
.iter()
197+
.map(|scopes|quote!(::std::string::ToString::to_string(#scopes)))
198+
.collect::<Vec<_>>();
194199
let requires =match&method_args.requires{
195200
Some(requires) =>{
196201
quote!{::std::option::Option::Some(::std::string::ToString::to_string(#requires))}
@@ -329,7 +334,7 @@ pub fn generate(
329334
&method.sig.output,
330335
"Resolver must have a return type",
331336
)
332-
.into())
337+
.into());
333338
}
334339
};
335340
let schema_ty = ty.value_type();
@@ -401,6 +406,7 @@ pub fn generate(
401406
visible: #visible,
402407
compute_complexity: #complexity,
403408
directive_invocations:::std::vec![ #(#directives),*],
409+
requires_scopes:::std::vec![ #(#requires_scopes),*],
404410
}));
405411
});
406412

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp