-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinject_source_early.go
68 lines (53 loc) · 1.52 KB
/
inject_source_early.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package autogql
import (
"fmt"
"log"
"github.com/fasibio/autogql/structure"
"github.com/vektah/gqlparser/v2/ast"
)
func (ggs *AutoGqlPlugin) InjectSourceEarly() *ast.Source {
log.Println("InjectSourceEarly")
input := fmt.Sprintf(`
input SqlCreateExtension {
value: Boolean!
directiveExt: [String!]
}
input SqlMutationParams {
add: SqlCreateExtension
update: SqlCreateExtension
delete: SqlCreateExtension
directiveExt: [String!]
}
input SqlQueryParams {
get: SqlCreateExtension
query: SqlCreateExtension
directiveExt: [String!]
}
directive @%s(order: Int, %s:SqlQueryParams, %s: SqlMutationParams ) on OBJECT
directive @%s on FIELD_DEFINITION
directive @%s on FIELD_DEFINITION
directive @%s (value: String)on FIELD_DEFINITION
directive @%s on FIELD_DEFINITION
directive @%s (value: [String!]) on FIELD_DEFINITION
directive @%s (value: [String!]) on FIELD_DEFINITION | OBJECT
scalar Time
scalar SoftDelete
# internal directive
directive @%s (value: [String!]) on INPUT_FIELD_DEFINITION
## internal directive end
`, structure.DirectiveSQL,
structure.DirectiveSQLArgumentQuery,
structure.DirectiveSQLArgumentMutation,
structure.DirectiveSQLPrimary,
structure.DirectiveSQLIndex,
structure.DirectiveSQLGorm,
structure.DirectiveNoMutation,
structure.DirectiveSQLInputTypeTags,
structure.DirectiveSQLInputTypeDirective,
structure.DirectiveSQLInputTypeTags.InternalName())
return &ast.Source{
Name: fmt.Sprintf("%s/directive.graphql", ggs.Name()),
Input: input,
BuiltIn: true,
}
}