• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

99designs / gqlgen / 12999394514

27 Jan 2025 10:16PM UTC coverage: 73.738% (-0.2%) from 73.891%
12999394514

Pull #3507

github

StevenACoffman
Regenerate

Signed-off-by: Steve Coffman <steve@khanacademy.org>
Pull Request #3507: Update gqlparser v2 to v2.5.22 to Support `@oneOf` and `@deprecated` on input values

4 of 27 new or added lines in 3 files covered. (14.81%)

2 existing lines in 1 file now uncovered.

8617 of 11686 relevant lines covered (73.74%)

545.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.3
/graphql/introspection/introspection.go
1
// introspection implements the spec defined in https://github.com/facebook/graphql/blob/master/spec/Section%204%20--%20Introspection.md#schema-introspection
2
package introspection
3

4
import (
5
        "github.com/vektah/gqlparser/v2/ast"
6
)
7

8
type (
9
        Directive struct {
10
                Name         string
11
                description  string
12
                Locations    []string
13
                Args         []InputValue
14
                IsRepeatable bool
15
        }
16

17
        EnumValue struct {
18
                Name        string
19
                description string
20
                deprecation *ast.Directive
21
        }
22

23
        Field struct {
24
                Name        string
25
                description string
26
                Type        *Type
27
                Args        []InputValue
28
                deprecation *ast.Directive
29
        }
30

31
        InputValue struct {
32
                Name         string
33
                description  string
34
                DefaultValue *string
35
                Type         *Type
36
                deprecation  *ast.Directive
37
        }
38
)
39

40
func WrapSchema(schema *ast.Schema) *Schema {
2✔
41
        return &Schema{schema: schema}
2✔
42
}
2✔
43

44
func (f *EnumValue) Description() *string {
68✔
45
        if f.description == "" {
136✔
46
                return nil
68✔
47
        }
68✔
48
        return &f.description
×
49
}
50

51
func (f *EnumValue) IsDeprecated() bool {
68✔
52
        return f.deprecation != nil
68✔
53
}
68✔
54

55
func (f *EnumValue) DeprecationReason() *string {
68✔
56
        if f.deprecation == nil {
136✔
57
                return nil
68✔
58
        }
68✔
59

60
        reason := f.deprecation.Arguments.ForName("reason")
×
61
        if reason == nil {
×
62
                return nil
×
63
        }
×
64

65
        return &reason.Value.Raw
×
66
}
67

68
func (f *Field) Description() *string {
516✔
69
        if f.description == "" {
1,032✔
70
                return nil
516✔
71
        }
516✔
72
        return &f.description
×
73
}
74

75
func (f *Field) IsDeprecated() bool {
518✔
76
        return f.deprecation != nil
518✔
77
}
518✔
78

79
func (f *Field) DeprecationReason() *string {
518✔
80
        if f.deprecation == nil || !f.IsDeprecated() {
1,034✔
81
                return nil
516✔
82
        }
516✔
83

84
        reason := f.deprecation.Arguments.ForName("reason")
2✔
85

2✔
86
        if reason == nil {
2✔
87
                defaultReason := "No longer supported"
×
88
                return &defaultReason
×
89
        }
×
90

91
        return &reason.Value.Raw
2✔
92
}
93

NEW
94
func (f *InputValue) IsDeprecated() bool {
×
NEW
95
        return f.deprecation != nil
×
NEW
96
}
×
97

NEW
98
func (f *InputValue) DeprecationReason() *string {
×
NEW
99
        if f.deprecation == nil {
×
NEW
100
                return nil
×
NEW
101
        }
×
102

NEW
103
        reason := f.deprecation.Arguments.ForName("reason")
×
NEW
104
        if reason == nil {
×
NEW
105
                return nil
×
NEW
106
        }
×
107

NEW
108
        return &reason.Value.Raw
×
109
}
110

111
func (f *InputValue) Description() *string {
308✔
112
        if f.description == "" {
616✔
113
                return nil
308✔
114
        }
308✔
115
        return &f.description
×
116
}
117

118
func (f *Directive) Description() *string {
46✔
119
        if f.description == "" {
82✔
120
                return nil
36✔
121
        }
36✔
122
        return &f.description
10✔
123
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc