-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a model and used directive on an input field within the integra…
…tion schema Added to the integration schema such that the build will catch the directive bug in question.
- Loading branch information
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package testserver | ||
|
||
import ( | ||
"fmt" | ||
"github.com/99designs/gqlgen/graphql" | ||
"io" | ||
"strconv" | ||
) | ||
|
||
type ThirdParty struct { | ||
str string | ||
} | ||
|
||
func MarshalThirdParty(tp ThirdParty) graphql.Marshaler { | ||
return graphql.WriterFunc(func(w io.Writer) { | ||
_, err := io.WriteString(w, strconv.Quote(tp.str)) | ||
if err != nil { | ||
panic(err) | ||
} | ||
}) | ||
} | ||
|
||
func UnmarshalThirdParty(input interface{}) (ThirdParty, error) { | ||
switch input := input.(type) { | ||
case string: | ||
return ThirdParty{str: input}, nil | ||
default: | ||
return ThirdParty{}, fmt.Errorf("unknown type for input: %s", input) | ||
} | ||
} |