@@ -183,7 +183,7 @@ impl<'a> Display for GraphqlDefinition<'a> {
183183 }
184184 writeln ! ( f) ?;
185185 writeln ! ( f) ?;
186- write ! ( f, "wundergraph_query_object !{{" ) ?;
186+ write ! ( f, "wundergraph::query_object !{{" ) ?;
187187 {
188188 let mut out = PadAdapter :: new ( f) ;
189189 writeln ! ( out) ?;
@@ -192,14 +192,8 @@ impl<'a> Display for GraphqlDefinition<'a> {
192192 let mut out = PadAdapter :: new ( & mut out) ;
193193 writeln ! ( out) ?;
194194 for t in self . tables {
195- let uppercase = uppercase_table_name ( & t. name . name ) ;
196195 let single = fix_table_name ( & t. name . name ) ;
197- writeln ! (
198- out,
199- "{upper}({single}, filter = {single}Filter)," ,
200- upper = uppercase,
201- single = single
202- ) ?;
196+ writeln ! ( out, "{}," , single) ?;
203197 }
204198 }
205199 writeln ! ( out, "}}" ) ?;
@@ -228,7 +222,8 @@ fn uppercase_table_name(name: &str) -> String {
228222 } else {
229223 Some ( c. to_string ( ) )
230224 }
231- } ) . fold ( String :: new ( ) , |acc, s| acc + & s)
225+ } )
226+ . fold ( String :: new ( ) , |acc, s| acc + & s)
232227}
233228
234229fn fix_table_name ( name : & str ) -> String {
@@ -261,21 +256,12 @@ where
261256
262257impl < ' a > Display for GraphqlData < ' a > {
263258 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
264- writeln ! ( f, "#[derive(Clone, Debug, Identifiable, WundergraphEntity)]" ) ?;
259+ writeln ! (
260+ f,
261+ "#[derive(Clone, Debug, Identifiable, WundergraphEntity)]"
262+ ) ?;
265263 writeln ! ( f, "#[table_name = \" {}\" ]" , self . table. name. name) ?;
266264 write_primary_key_section ( f, self . table ) ?;
267- // for key in self
268- // .foreign_keys
269- // .iter()
270- // .filter(|f| f.child_table == self.table.name)
271- // {
272- // writeln!(
273- // f,
274- // "#[belongs_to({parent}, foreign_key = \"{foreign_key}\")]",
275- // parent = fix_table_name(&key.parent_table.name),
276- // foreign_key = key.foreign_key
277- // )?
278- // }
279265 write ! ( f, "pub struct {} {{" , fix_table_name( & self . table. name. name) ) ?;
280266 {
281267 let mut out = PadAdapter :: new ( f) ;
@@ -310,7 +296,6 @@ impl<'a> Display for GraphqlData<'a> {
310296 }
311297}
312298
313-
314299struct GraphqlColumn < ' a > {
315300 column : & ' a ColumnDefinition ,
316301 foreign_key : Option < & ' a ForeignKeyConstraint > ,
@@ -354,9 +339,7 @@ impl<'a> Display for GraphqlType<'a> {
354339 match * self . sql_type {
355340 ColumnType {
356341 is_nullable : true , ..
357- }
358- if self . allow_option =>
359- {
342+ } if self . allow_option => {
360343 let mut t = self . clone ( ) ;
361344 t. allow_option = false ;
362345 write ! ( f, "Option<{}>" , t) ?;
@@ -433,7 +416,7 @@ impl<'a> Display for GraphqlMutations<'a> {
433416 writeln ! ( f, "{}" , GraphqlChangeSet { table: t } ) ?;
434417 }
435418
436- write ! ( f, "wundergraph_mutation_object !{{" ) ?;
419+ write ! ( f, "wundergraph::mutation_object !{{" ) ?;
437420 {
438421 let mut out = PadAdapter :: new ( f) ;
439422 writeln ! ( out) ?;
@@ -473,7 +456,7 @@ impl<'a> Display for GraphqlInsertable<'a> {
473456 writeln ! ( f, "#[derive(Insertable, GraphQLInputObject, Clone, Debug)]" ) ?;
474457 writeln ! ( f, "#[graphql(scalar = \" WundergraphScalarValue\" )]" ) ?;
475458 writeln ! ( f, "#[table_name = \" {}\" ]" , self . table. name) ?;
476- write ! ( f, "struct New{} {{" , fix_table_name( & self . table. name. name) ) ?;
459+ write ! ( f, "pub struct New{} {{" , fix_table_name( & self . table. name. name) ) ?;
477460 {
478461 let mut out = PadAdapter :: new ( f) ;
479462 writeln ! ( out) ?;
@@ -509,7 +492,7 @@ impl<'a> Display for GraphqlChangeSet<'a> {
509492 write_primary_key_section ( f, self . table ) ?;
510493 write ! (
511494 f,
512- "struct {}Changeset {{" ,
495+ "pub struct {}Changeset {{" ,
513496 fix_table_name( & self . table. name. name)
514497 ) ?;
515498 {
0 commit comments