@@ -31,6 +31,19 @@ public ClientGenerator(string namespaceName, string clientName, bool includeSubs
3131
3232 private void AddFile ( string directory , string fileName , string content )
3333 {
34+ var infoText = $@ "
35+ //---------------------------------------------------------------------
36+ // This code was automatically generated by Linq2GraphQL
37+ // Please don't edit this file
38+ // Github:https://github.com/linq2graphql/linq2graphql.client
39+ // Url: https://linq2graphql.com
40+ // Generation Date: { DateTimeOffset . Now . ToString ( "F" ) }
41+ //---------------------------------------------------------------------
42+
43+ " ;
44+
45+ content = infoText + content ;
46+
3447 entries . Add ( new FileEntry { Content = content , DirectoryName = directory , FileName = fileName } ) ;
3548 }
3649
@@ -125,9 +138,18 @@ public List<FileEntry> Generate(string schemaJson)
125138 AddFile ( "Inputs" , classType . FileName , classText ) ;
126139 }
127140
128- Console . WriteLine ( "Generate InputFactory..." ) ;
129- var inputFactoryText = new InputFactoryClassTemplate ( inputs , namespaceName ) . TransformText ( ) ;
130- AddFile ( "Inputs" , "InputFactory.cs" , inputFactoryText ) ;
141+ if ( GeneratorSettings . Current . Nullable )
142+ {
143+ Console . WriteLine ( "No InputFactory for a Nullable client " ) ;
144+ }
145+ else
146+ {
147+ Console . WriteLine ( "Generate InputFactory..." ) ;
148+ var inputFactoryText = new InputFactoryClassTemplate ( inputs , namespaceName ) . TransformText ( ) ;
149+ AddFile ( "Inputs" , "InputFactory.cs" , inputFactoryText ) ;
150+ }
151+
152+
131153
132154 Console . WriteLine ( "Generate Enums..." ) ;
133155 foreach ( var enumType in schema . GetEnums ( ) )
@@ -155,7 +177,7 @@ public List<FileEntry> Generate(string schemaJson)
155177 }
156178
157179
158- Console . WriteLine ( "Generate Client..." ) ;
180+ Console . WriteLine ( "Generate Client..." ) ;
159181 var templateText = new ClientTemplate ( namespaceName , clientName , queryType , mutationType , subscriptionType )
160182 . TransformText ( ) ;
161183 var fileName = clientName + ".cs" ;
0 commit comments