这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@tirumaraiselvan
Copy link
Contributor

No-op code refactor/cleanup

Description

What component does this PR affect?

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Requires changes from other components? If yes, please mark the components:

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Related Issue

Solution and Design

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • Community content
  • No-op

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.
  • I have added required tests.

@tirumaraiselvan tirumaraiselvan added the s/wip Status: This issue is a work in progress label Feb 20, 2019
@tirumaraiselvan tirumaraiselvan force-pushed the event-triggers-refactor branch 4 times, most recently from 37e2a2f to 6a50324 Compare February 20, 2019 18:10
@hasura-bot
Copy link
Contributor

Review app for commit cab75bd deployed to Heroku: https://hge-ci-pull-1639.herokuapp.com
Docker image for server: hasura/graphql-engine:pull1639-cab75bd

let EventEngineCtx _ c _ _ = eeCtx
modifyTVar' c (\v -> v - 1)

case eitherResp of
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a one liner for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use onLeft from GraphQL.Utils. Also please move onNothing, onJust, onLeft from GraphQL.Utils to Hasura.Prelude

@tirumaraiselvan tirumaraiselvan removed the s/wip Status: This issue is a work in progress label Feb 21, 2019
Copy link
Member

@0x777 0x777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More generally

  1. Remove type annotations where not needed
  2. Keep the line limit to 80-90 chars

res <- tryWebhook logenv pool e
finally <- either errorFn successFn res
liftIO $ either (logQErr logger) (void.return) finally
cacheRef::CacheRef <- asks getter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need these type annotations


logQErr :: ( MonadReader r m, MonadIO m, Has HLogger r) => QErr -> m ()
logQErr err = do
(logger:: HLogger) <- asks getter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. You don't need these annotations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some other context, these variables were not resolving to correct type without annotation. But they seem to be fine now.

let EventEngineCtx _ c _ _ = eeCtx
modifyTVar' c (\v -> v - 1)

case eitherResp of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use onLeft from GraphQL.Utils. Also please move onNothing, onJust, onLeft from GraphQL.Utils to Hasura.Prelude

@hasura hasura deleted a comment from 0x777 Feb 22, 2019
@hasura-bot
Copy link
Contributor

Review app for commit 5129728 deployed to Heroku: https://hge-ci-pull-1639.herokuapp.com
Docker image for server: hasura/graphql-engine:pull1639-5129728

@0x777 0x777 merged commit 7851015 into hasura:master Feb 22, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-1639.herokuapp.com is deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants