We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09b69a9 commit 583d94aCopy full SHA for 583d94a
graphql_query_derive/src/shared.rs
@@ -35,7 +35,15 @@ pub(crate) fn render_object_field(
35
36
let description = description.map(|s| quote!(#[doc = #s]));
37
38
- if field_name == "type" {
+ let reserved = &[
39
+ "abstract", "alignof", "as", "become", "box", "break", "const", "continue", "crate", "do",
40
+ "else", "enum", "extern", "false", "final", "fn", "for", "if", "impl", "in", "let", "loop",
41
+ "macro", "match", "mod", "move", "mut", "offsetof", "override", "priv", "proc", "pub",
42
+ "pure", "ref", "return", "Self", "self", "sizeof", "static", "struct", "super", "trait",
43
+ "true", "type", "typeof", "unsafe", "unsized", "use", "virtual", "where", "while", "yield",
44
+ ];
45
+
46
+ if reserved.contains(&field_name) {
47
let name_ident = Ident::new(&format!("{}_", field_name), Span::call_site());
48
return quote! {
49
#description
0 commit comments