allow globbing, and extract queries from .go files

This commit is contained in:
Ben Kraft
2021-04-01 12:34:51 -07:00
parent ec6681e715
commit eae68e43c9
38 changed files with 256 additions and 21 deletions
+46
View File
@@ -0,0 +1,46 @@
package parsing
const MyFragment = `
# @genqlient
fragment MyFragment on MyType {
myFragmentField
...NestedFragment
}
`
var _ = `
# @genqlient
fragment NestedFragment on MyType {
myOtherFragmentField
}
`
const MyQuery = `
# @genqlient
query MyQuery {
myField
myOtherField {
...MyFragment
}
}
`
func query(s string) {}
func MyMutation() {
query(`
# @genqlient
mutation MyMutation {
myField
myOtherField {
...MyFragment
}
}
`)
}
const (
NotAString = 1
NotAQuery = `query
writing with GraphQL is fun!`
)
+19
View File
@@ -0,0 +1,19 @@
query MyQuery {
myField
myOtherField {
...MyFragment
}
}
fragment MyFragment on MyType {
myFragmentField
...NestedFragment
}
fragment UnusedFragment on MyType {
myFragmentField
}
fragment NestedFragment on MyType {
myOtherFragmentField
}
+8
View File
@@ -0,0 +1,8 @@
package parsing
const _ = `
# @genqlient
fragment UnusedFragment on MyType {
myFragmentField
}
`
+6
View File
@@ -0,0 +1,6 @@
mutation MyMutation {
myField
myOtherField {
...MyFragment
}
}