Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

refactor: graphql adapter #40

Merged
merged 9 commits into from Aug 31, 2021
Merged

refactor: graphql adapter #40

merged 9 commits into from Aug 31, 2021

Conversation

rot1024
Copy link
Member

@rot1024 rot1024 commented Aug 27, 2021

In particular, the GraphQL code was very difficult to understand, so I refactored it to make it easier to change the implementation of GraphQL resolvers.

  • Unify 2 packages into internal/adapter/gql
    • internal/adapter/graphql
    • internal/graphql
  • Separate packages for data loaders (gqldataloader) and models (gqlmodel)
    • Functions in gqlmodel are now public and ready to write unit tests
  • "Controllers" in gql package have been abolished
    • Loaders will continue to be responsible for loading the data
    • The process of updating the data is now implemented directly in the resolvers of GraphQL
  • Add asset node query
  • Remove updatePropertyValue* mutations (updatePropertyValue mutation replaces them)

Note: From now on, you can use this command to generate code from the GraphQL schema: go generate ./internal/adapter/gql

@codecov
Copy link

codecov bot commented Aug 27, 2021

Codecov Report

Merging #40 (d733227) into main (2e4f52a) will decrease coverage by 0.19%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
- Coverage   16.60%   16.40%   -0.20%     
==========================================
  Files         223      241      +18     
  Lines       41198    41693     +495     
==========================================
  Hits         6841     6841              
- Misses      33365    33860     +495     
  Partials      992      992              
Impacted Files Coverage Δ
internal/adapter/gql/context.go 0.00% <ø> (ø)
internal/adapter/gql/generated.go 0.00% <ø> (ø)
internal/adapter/gql/loader.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_asset.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_dataset.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_layer.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_plugin.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_project.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_property.go 0.00% <0.00%> (ø)
internal/adapter/gql/loader_scene.go 0.00% <0.00%> (ø)
... and 58 more

yk-eukarya
yk-eukarya previously approved these changes Aug 30, 2021
Copy link
Contributor

@yk-eukarya yk-eukarya left a comment

Choose a reason for hiding this comment

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

LGTM

mimoham24
mimoham24 previously approved these changes Aug 31, 2021
Copy link
Contributor

@mimoham24 mimoham24 left a comment

Choose a reason for hiding this comment

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

just wanted to remind you that the code coverage is not so good

@rot1024 rot1024 dismissed stale reviews from mimoham24 and yk-eukarya via d733227 August 31, 2021 06:51
@rot1024 rot1024 merged commit 2a1d4fd into main Aug 31, 2021
@rot1024 rot1024 deleted the refactor/gql branch August 31, 2021 09:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants