-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- the past resolvers used an all CAPS system to differentiate the resolvers from the other methods, this was strange and felt wrong. THey have been changed into their own structs which have the db added in through a dependency injection - added some helper functions for converting graphql and number types - added a logging middleware - changed some errant int32's to graphql.ID's - added .gqlint file - changed the schema descriptions to be quotes strings instead of comments
- Loading branch information
1 parent
473e22b
commit 9cb230d
Showing
11 changed files
with
542 additions
and
345 deletions.
There are no files selected for viewing
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,12 @@ | ||
{ | ||
"rules": { | ||
"camelcase": "error", | ||
"fieldname.typename": "off", | ||
"relay.connection": "error", | ||
"relay.id": "error", | ||
"singular.mutations": "error", | ||
"enum.casing": "error", | ||
"description.type": "warn", | ||
"description.field": "off" | ||
} | ||
} |
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,32 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"strconv" | ||
|
||
graphql "github.com/graph-gophers/graphql-go" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
func gqlIDToUint(i graphql.ID) (uint, error) { | ||
r, err := strconv.ParseInt(string(i), 10, 32) | ||
if err != nil { | ||
return 0, errors.Wrap(err, "GqlIDToUint") | ||
} | ||
|
||
return uint(r), nil | ||
} | ||
|
||
func int32P(i uint) *int32 { | ||
r := int32(i) | ||
return &r | ||
} | ||
|
||
func boolP(b bool) *bool { | ||
return &b | ||
} | ||
|
||
func gqlIDP(id uint) *graphql.ID { | ||
r := graphql.ID(fmt.Sprint(id)) | ||
return &r | ||
} |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.