-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor schema.hs into multiple modules #2661
Conversation
Deploy preview for hasura-docs ready! Built with commit 08282ad |
Review app for commit 31ded71 deployed to Heroku: https://hge-ci-pull-2661.herokuapp.com |
@@ -215,6 +215,16 @@ library | |||
, Hasura.GraphQL.Transport.WebSocket.Protocol | |||
, Hasura.GraphQL.Transport.WebSocket.Server | |||
, Hasura.GraphQL.Transport.WebSocket | |||
, Hasura.GraphQL.Schema.BoolExp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code from Schema.hs
is more or less moved into these new modules without any functionality change.
|
||
type OpCtxMap = Map.HashMap G.Name OpCtx | ||
|
||
data InsOpCtx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types are related to the Resolve
module and they have been moved to Types.hs
in Resolve
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the same time ContextTypes.hs
has been renamed/merged into Types.hs
with the above inclusions.
|
||
emptyGCtx :: GCtx | ||
emptyGCtx = mkGCtx mempty mempty mempty | ||
emptyGCtx = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously creating an empty GCtx
was done with mkGCtx
which lead to all sorts of cyclic dependencies and code being in incorrect modules. Now emptyGCtx
is implemented separately with both mkGCtx
and emptyGCtx
sharing the common functionality (this could be improved further though).
, UpdPermForIns(..) | ||
, InsCtx(..) | ||
, InsCtxMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these are now part of Resolve.Types
module and that is exposed by this module.
} deriving (Show, Eq) | ||
$(J.deriveJSON (J.aesonDrop 3 J.snakeCase) ''InsResp) | ||
|
||
data AnnPGVal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to Types
@@ -0,0 +1,54 @@ | |||
module Hasura.GraphQL.Schema.Common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common
for lack of a better name. These functions/values are imported by more than one sub-module under Schema
.
@@ -0,0 +1,52 @@ | |||
module Hasura.GraphQL.Schema.Mutation.Common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further hierarchy for Mutation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me; thank you for taking the time to do this!
Mostly moving around things across modules. No change in functionality.
31ded71
to
08282ad
Compare
Review app for commit 08282ad deployed to Heroku: https://hge-ci-pull-2661.herokuapp.com |
Review app https://hge-ci-pull-2661.herokuapp.com is deleted |
Mostly moving around things across modules. No change in functionality.
Schema.hs
has become a little unwieldy over the past few months. This PR does not attempt to fix all the issues withSchema.hs
has but sets up a base for further improvements. This PR does two things: