Repository: Khan/genqlient
Pull request #161 (2021-12-18 16:17:33)

Move 'Code generated by' disclaimer up
`Code generated by` disclaimer should be at the top of the file, as it is demonstrated in [this article](https://go.dev/blog/generate) on The Go Blog.

The current placing breaks integration with some code formatters and linters which do no skip files generated by `genqlient`. 

csilvers: Thanks! I know it's a small change but can you sign the CLA of you haven't already?  https://www.khanacademy.org/r/cla
benjaminjkraft: Ah, thanks for noticing! It looks like the rule changed with golang/go#41196, which is why I remember it being anywhere in the file but in fact the [go generate docs](https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source) now clearly say
> This line must appear before the first non-comment, non-blank text in the file.

I've just clicked to let CI run; I think you'll need to update some of the text fixtures to match, which you can do via e.g.
```sh
go generate ./...
UPDATE_SNAPSHOTS=1 go test ./...
```
Once you've done that, looks great to me!
adambabik: Thanks for the guidelines. I updated snapshots and rerun tests - they passed locally.

Patch:
diff --git a/example/generated.go b/example/generated.go
index 115b99e..85b041e 100644
--- a/example/generated.go
+++ b/example/generated.go
@@ -1,7 +1,7 @@
-package main
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package main
+
 import (
 	"context"
 	"time"
diff --git a/generate/header.go.tmpl b/generate/header.go.tmpl
index 0055504..aa45363 100644
--- a/generate/header.go.tmpl
+++ b/generate/header.go.tmpl
@@ -1,7 +1,7 @@
-package {{.Config.Package}}
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package {{.Config.Package}}
+
 {{.Imports}}
 
 {{if and (ne .Config.ContextType "-") (ne .Config.ContextType "context.Context") }}
diff --git a/internal/integration/generated.go b/internal/integration/generated.go
index 88176cc..9dece1b 100644
--- a/internal/integration/generated.go
+++ b/internal/integration/generated.go
@@ -1,7 +1,7 @@
-package integration
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package integration
+
 import (
 	"context"
 	"encoding/json"


Test patch:
diff --git a/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go
index 0e46884..cafb9f1 100644
--- a/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-ComplexInlineFragments.graphql-ComplexInlineFragments.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go
index f0b095d..e07a78a 100644
--- a/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-ComplexNamedFragments.graphql-ComplexNamedFragments.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-CustomMarshal.graphql-CustomMarshal.graphql.go b/generate/testdata/snapshots/TestGenerate-CustomMarshal.graphql-CustomMarshal.graphql.go
index f4cf968..e8c450d 100644
--- a/generate/testdata/snapshots/TestGenerate-CustomMarshal.graphql-CustomMarshal.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-CustomMarshal.graphql-CustomMarshal.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go b/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go
index 4ad9b75..0156935 100644
--- a/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-CustomMarshalSlice.graphql-CustomMarshalSlice.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-DateTime.graphql-DateTime.graphql.go b/generate/testdata/snapshots/TestGenerate-DateTime.graphql-DateTime.graphql.go
index 17d4a46..581ec42 100644
--- a/generate/testdata/snapshots/TestGenerate-DateTime.graphql-DateTime.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-DateTime.graphql-DateTime.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"time"
 
diff --git a/generate/testdata/snapshots/TestGenerate-EmptyInterface.graphql-EmptyInterface.graphql.go b/generate/testdata/snapshots/TestGenerate-EmptyInterface.graphql-EmptyInterface.graphql.go
index 0cdd5db..96726d9 100644
--- a/generate/testdata/snapshots/TestGenerate-EmptyInterface.graphql-EmptyInterface.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-EmptyInterface.graphql-EmptyInterface.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go b/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go
index 184def9..07a9ee1 100644
--- a/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-Flatten.graphql-Flatten.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-InputEnum.graphql-InputEnum.graphql.go b/generate/testdata/snapshots/TestGenerate-InputEnum.graphql-InputEnum.graphql.go
index e17d917..fc8bde6 100644
--- a/generate/testdata/snapshots/TestGenerate-InputEnum.graphql-InputEnum.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-InputEnum.graphql-InputEnum.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-InputObject.graphql-InputObject.graphql.go b/generate/testdata/snapshots/TestGenerate-InputObject.graphql-InputObject.graphql.go
index 57f6ded..4d2cc3c 100644
--- a/generate/testdata/snapshots/TestGenerate-InputObject.graphql-InputObject.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-InputObject.graphql-InputObject.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go
index a58b7f9..4c36912 100644
--- a/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-InterfaceListField.graphql-InterfaceListField.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go
index 0c775cd..8c6ea34 100644
--- a/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-InterfaceListOfListsOfListsField.graphql-InterfaceListOfListsOfListsField.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceNesting.graphql-InterfaceNesting.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceNesting.graphql-InterfaceNesting.graphql.go
index a5ae8a8..1f87eab 100644
--- a/generate/testdata/snapshots/TestGenerate-InterfaceNesting.graphql-InterfaceNesting.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-InterfaceNesting.graphql-InterfaceNesting.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go
index 7a161af..4b52c9d 100644
--- a/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-InterfaceNoFragments.graphql-InterfaceNoFragments.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.graphql.go b/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.graphql.go
index 9920cd1..4bf5172 100644
--- a/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-ListOfListsOfLists.graphql-ListOfListsOfLists.graphql.go b/generate/testdata/snapshots/TestGenerate-ListOfListsOfLists.graphql-ListOfListsOfLists.graphql.go
index 3b76252..f6399ad 100644
--- a/generate/testdata/snapshots/TestGenerate-ListOfListsOfLists.graphql-ListOfListsOfLists.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-ListOfListsOfLists.graphql-ListOfListsOfLists.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go b/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go
index b454883..6e39da0 100644
--- a/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-MultipleDirectives.graphql-MultipleDirectives.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go b/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go
index f5fb8a7..2413984 100644
--- a/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-Omitempty.graphql-Omitempty.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go b/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go
index f0a7437..3378941 100644
--- a/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-Pointers.graphql-Pointers.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go b/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go
index 7e03481..a01827a 100644
--- a/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-PointersInline.graphql-PointersInline.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go b/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go
index 3a260bb..edc9fcf 100644
--- a/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-Pokemon.graphql-Pokemon.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-QueryWithAlias.graphql-QueryWithAlias.graphql.go b/generate/testdata/snapshots/TestGenerate-QueryWithAlias.graphql-QueryWithAlias.graphql.go
index 83e4ebc..6af1bfc 100644
--- a/generate/testdata/snapshots/TestGenerate-QueryWithAlias.graphql-QueryWithAlias.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-QueryWithAlias.graphql-QueryWithAlias.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-QueryWithDoubleAlias.graphql-QueryWithDoubleAlias.graphql.go b/generate/testdata/snapshots/TestGenerate-QueryWithDoubleAlias.graphql-QueryWithDoubleAlias.graphql.go
index cd92930..0544f5a 100644
--- a/generate/testdata/snapshots/TestGenerate-QueryWithDoubleAlias.graphql-QueryWithDoubleAlias.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-QueryWithDoubleAlias.graphql-QueryWithDoubleAlias.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-QueryWithEnums.graphql-QueryWithEnums.graphql.go b/generate/testdata/snapshots/TestGenerate-QueryWithEnums.graphql-QueryWithEnums.graphql.go
index 2ed1f3e..f14f00f 100644
--- a/generate/testdata/snapshots/TestGenerate-QueryWithEnums.graphql-QueryWithEnums.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-QueryWithEnums.graphql-QueryWithEnums.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerate-QueryWithSlices.graphql-QueryWithSlices.graphql.go b/generate/testdata/snapshots/TestGenerate-QueryWithSlices.graphql-QueryWithSlices.graphql.go
index 49ea9b5..f83f4f6 100644
--- a/generate/testdata/snapshots/TestGenerate-QueryWithSlices.graphql-QueryWithSlices.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-QueryWithSlices.graphql-QueryWithSlices.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerate-QueryWithStructs.graphql-QueryWithStructs.graphql.go b/generate/testdata/snapshots/TestGenerate-QueryWithStructs.graphql-QueryWithStructs.graphql.go
index 5c658dd..0c6e9be 100644
--- a/generate/testdata/snapshots/TestGenerate-QueryWithStructs.graphql-QueryWithStructs.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-QueryWithStructs.graphql-QueryWithStructs.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go b/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go
index 5d4db7d..6547708 100644
--- a/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-Recursion.graphql-Recursion.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-SimpleInlineFragment.graphql-SimpleInlineFragment.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleInlineFragment.graphql-SimpleInlineFragment.graphql.go
index a84894f..fde1953 100644
--- a/generate/testdata/snapshots/TestGenerate-SimpleInlineFragment.graphql-SimpleInlineFragment.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-SimpleInlineFragment.graphql-SimpleInlineFragment.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-SimpleInput.graphql-SimpleInput.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleInput.graphql-SimpleInput.graphql.go
index 3680024..78d6209 100644
--- a/generate/testdata/snapshots/TestGenerate-SimpleInput.graphql-SimpleInput.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-SimpleInput.graphql-SimpleInput.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go
index 1674805..8601bc4 100644
--- a/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-SimpleMutation.graphql-SimpleMutation.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-SimpleNamedFragment.graphql-SimpleNamedFragment.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleNamedFragment.graphql-SimpleNamedFragment.graphql.go
index 9b0e7b7..a1ce320 100644
--- a/generate/testdata/snapshots/TestGenerate-SimpleNamedFragment.graphql-SimpleNamedFragment.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-SimpleNamedFragment.graphql-SimpleNamedFragment.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-SimpleQuery.graphql-SimpleQuery.graphql.go b/generate/testdata/snapshots/TestGenerate-SimpleQuery.graphql-SimpleQuery.graphql.go
index 943b48a..2d9ead5 100644
--- a/generate/testdata/snapshots/TestGenerate-SimpleQuery.graphql-SimpleQuery.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-SimpleQuery.graphql-SimpleQuery.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go b/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go
index 37761d1..e5a9084 100644
--- a/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-StructOption.graphql-StructOption.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-TypeName.graphql-TypeName.graphql.go b/generate/testdata/snapshots/TestGenerate-TypeName.graphql-TypeName.graphql.go
index e8fb5ce..da9892c 100644
--- a/generate/testdata/snapshots/TestGenerate-TypeName.graphql-TypeName.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-TypeName.graphql-TypeName.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 	"github.com/Khan/genqlient/internal/testutil"
diff --git a/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go b/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go
index c30cf92..09deb38 100644
--- a/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-TypeNames.graphql-TypeNames.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-UnionNoFragments.graphql-UnionNoFragments.graphql.go b/generate/testdata/snapshots/TestGenerate-UnionNoFragments.graphql-UnionNoFragments.graphql.go
index fefeca8..67de465 100644
--- a/generate/testdata/snapshots/TestGenerate-UnionNoFragments.graphql-UnionNoFragments.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-UnionNoFragments.graphql-UnionNoFragments.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerate-UsesEnumTwice.graphql-UsesEnumTwice.graphql.go b/generate/testdata/snapshots/TestGenerate-UsesEnumTwice.graphql-UsesEnumTwice.graphql.go
index 47f76c6..5864d35 100644
--- a/generate/testdata/snapshots/TestGenerate-UsesEnumTwice.graphql-UsesEnumTwice.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-UsesEnumTwice.graphql-UsesEnumTwice.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerate-unexported.graphql-unexported.graphql.go b/generate/testdata/snapshots/TestGenerate-unexported.graphql-unexported.graphql.go
index a499002..81eebc2 100644
--- a/generate/testdata/snapshots/TestGenerate-unexported.graphql-unexported.graphql.go
+++ b/generate/testdata/snapshots/TestGenerate-unexported.graphql-unexported.graphql.go
@@ -1,7 +1,7 @@
-package test
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package test
+
 import (
 	"encoding/json"
 	"fmt"
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetter-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetter-testdata-queries-generated.go
index 1a26430..360947f 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetter-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetter-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterCustomContext-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterCustomContext-testdata-queries-generated.go
index 2305948..36e6798 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterCustomContext-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterCustomContext-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterNoContext-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterNoContext-testdata-queries-generated.go
index 7baafda..9d3e139 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterNoContext-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-ClientGetterNoContext-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"github.com/Khan/genqlient/internal/testutil"
 )
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-CustomContext-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-CustomContext-testdata-queries-generated.go
index bd7e0a1..d15c27a 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-CustomContext-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-CustomContext-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-DefaultConfig-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-DefaultConfig-testdata-queries-generated.go
index cf00605..6b08b6b 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-DefaultConfig-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-DefaultConfig-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-ExportOperations-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-ExportOperations-testdata-queries-generated.go
index cf00605..6b08b6b 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-ExportOperations-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-ExportOperations-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-NoContext-testdata-queries-generated.go b/generate/testdata/snapshots/TestGenerateWithConfig-NoContext-testdata-queries-generated.go
index a2bfc36..16d0538 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-NoContext-testdata-queries-generated.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-NoContext-testdata-queries-generated.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"github.com/Khan/genqlient/graphql"
 )
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-PackageName-testdata-queries-myfile.go b/generate/testdata/snapshots/TestGenerateWithConfig-PackageName-testdata-queries-myfile.go
index b9348a6..9006b4b 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-PackageName-testdata-queries-myfile.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-PackageName-testdata-queries-myfile.go
@@ -1,7 +1,7 @@
-package mypkg
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package mypkg
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-StructReferences-testdata-queries-generated-structrefs.go b/generate/testdata/snapshots/TestGenerateWithConfig-StructReferences-testdata-queries-generated-structrefs.go
index e22ee66..24b17f3 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-StructReferences-testdata-queries-generated-structrefs.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-StructReferences-testdata-queries-generated-structrefs.go
@@ -1,7 +1,7 @@
-package queries
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package queries
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-Subpackage-testdata-queries-mypkg-myfile.go b/generate/testdata/snapshots/TestGenerateWithConfig-Subpackage-testdata-queries-mypkg-myfile.go
index b9348a6..9006b4b 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-Subpackage-testdata-queries-mypkg-myfile.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-Subpackage-testdata-queries-mypkg-myfile.go
@@ -1,7 +1,7 @@
-package mypkg
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package mypkg
+
 import (
 	"context"
 
diff --git a/generate/testdata/snapshots/TestGenerateWithConfig-SubpackageConfig-testdata-queries-mypkg-myfile.go b/generate/testdata/snapshots/TestGenerateWithConfig-SubpackageConfig-testdata-queries-mypkg-myfile.go
index b9348a6..9006b4b 100644
--- a/generate/testdata/snapshots/TestGenerateWithConfig-SubpackageConfig-testdata-queries-mypkg-myfile.go
+++ b/generate/testdata/snapshots/TestGenerateWithConfig-SubpackageConfig-testdata-queries-mypkg-myfile.go
@@ -1,7 +1,7 @@
-package mypkg
-
 // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
 
+package mypkg
+
 import (
 	"context"