Skip to content
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

fix: Add missing directive definitions #2369

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #2312

Description

This PR adds the missing directive definitions (@crdt, @primary, @relation) to GraphQL

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

tested in GraphQL client

Specify the platform(s) on which this was tested:

  • MacOS

@fredcarle fredcarle added bug Something isn't working area/schema Related to the schema system labels Mar 4, 2024
@fredcarle fredcarle added this to the DefraDB v0.10 milestone Mar 4, 2024
@fredcarle fredcarle requested a review from a team March 4, 2024 18:04
@fredcarle fredcarle self-assigned this Mar 4, 2024
Copy link
Member

@nasdf nasdf left a comment

Choose a reason for hiding this comment

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

Looks good! Just one non-blocking question

Description: crdtDirectiveDescription,
Args: gql.FieldConfigArgument{
CRDTDirectivePropType: &gql.ArgumentConfig{
Type: gql.String,
Copy link
Member

Choose a reason for hiding this comment

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

question: Would it be possible to make this an enum type that consists of all of our supported CRDT types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made the change to enum. Let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

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

Nice work! This will be super helpful for people learning about CRDT types.

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.89%. Comparing base (eb872f5) to head (e9511c4).
Report is 1 commits behind head on develop.

❗ Current head e9511c4 differs from pull request most recent head eeada2a. Consider uploading reports for the commit eeada2a to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2369      +/-   ##
===========================================
- Coverage    75.03%   74.89%   -0.14%     
===========================================
  Files          266      266              
  Lines        25855    25857       +2     
===========================================
- Hits         19400    19365      -35     
- Misses        5150     5177      +27     
- Partials      1305     1315      +10     
Flag Coverage Δ
all-tests 74.89% <100.00%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
request/graphql/schema/collection.go 90.77% <100.00%> (+0.45%) ⬆️
request/graphql/schema/manager.go 97.54% <100.00%> (+0.06%) ⬆️
request/graphql/schema/types/types.go 100.00% <ø> (ø)

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a195e0f...eeada2a. Read the comment docs.

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LGTM, just a non-blocking thought.

thought: I know Index* directives were there before, but do we want to somehow separate the Schema Directives from the Operation Directives (on Request/Query).

For example @explain is not a Schema Directive.

@fredcarle
Copy link
Collaborator Author

thought: I know Index* directives were there before, but do we want to somehow separate the Schema Directives from the Operation Directives (on Request/Query).

For example @explain is not a Schema Directive.

I think it's worth looking into it. But in a different PR :)

@fredcarle fredcarle force-pushed the fredcarle/fix/i2312-missing-directive-def branch from 6373a44 to e9511c4 Compare March 5, 2024 17:46
@fredcarle fredcarle force-pushed the fredcarle/fix/i2312-missing-directive-def branch from e9511c4 to eeada2a Compare March 5, 2024 21:14
@fredcarle fredcarle merged commit 3963bf4 into sourcenetwork:develop Mar 5, 2024
27 of 28 checks passed
@fredcarle fredcarle deleted the fredcarle/fix/i2312-missing-directive-def branch March 5, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema Related to the schema system bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing directive definitions in GQL schema
4 participants