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

Use new version of async-graphql for dynamic schema generation #287

Merged
merged 74 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
04ac360
Update async-graphql
sandreae Mar 7, 2023
4f1af12
Update axum to 0.6.1
sandreae Mar 7, 2023
65a81ad
async-graphql API updates
sandreae Mar 7, 2023
fdb5e8a
Remove dynamic query module and types
sandreae Mar 7, 2023
9595cad
Remove static schema provider
sandreae Mar 7, 2023
66bf440
Remove build root schema workaround
sandreae Mar 7, 2023
8adb765
Create a schema dynamically
sandreae Mar 7, 2023
fb2b0cc
Add comment
sandreae Mar 7, 2023
7b4dc4d
Dynamically generate simple query object
sandreae Mar 8, 2023
8b5cc9c
Typed return values in dynamic query fields
sandreae Mar 8, 2023
12a3dcc
With argument
sandreae Mar 8, 2023
441f3ac
With descriptions
sandreae Mar 8, 2023
0822afc
Add next args method and return type dynamically
sandreae Mar 9, 2023
ffb3e7f
Create new dynamic_graphql module
sandreae Mar 9, 2023
8de0ef7
Restore schema.rs in old graphql module
sandreae Mar 9, 2023
f1e85e8
Register scalar types on the dynamic schema
sandreae Mar 9, 2023
7eb8f99
Parse nextArgs arguments
sandreae Mar 9, 2023
0130707
Add all schema from the schema provider to the root query object
sandreae Mar 9, 2023
8997489
Add data the root schema
sandreae Mar 9, 2023
4d0e1ef
Small fix in schema
sandreae Mar 9, 2023
ec17468
Add document object type for every schema
sandreae Mar 9, 2023
d6da29b
Refactor document field type
sandreae Mar 9, 2023
18e5996
Introduce DocumentMeta type
sandreae Mar 9, 2023
b642192
Move descriptions to type definitions
sandreae Mar 9, 2023
c7ca5ef
WIP: actually query documents
sandreae Mar 9, 2023
0e25934
WIP: pass result down to selected query values
sandreae Mar 10, 2023
6c43c54
Lovely refactor as a result of better understanding
sandreae Mar 10, 2023
2b56d5e
Introduce MutationRoot with publish method
sandreae Mar 10, 2023
ce9af2d
Refactor next_args and argument parsing
sandreae Mar 10, 2023
ab59de3
Refactor schema builders into own modules
sandreae Mar 11, 2023
73a0cbf
Bring across next args tests
sandreae Mar 11, 2023
7fefeb8
Small fixes
sandreae Mar 11, 2023
5f33716
Replace previous graphql module with next
sandreae Mar 11, 2023
7a15b26
Fix argument name
sandreae Mar 11, 2023
1e767ae
Return Null instead of None from empty document fields in query
sandreae Mar 11, 2023
83941f6
Bring back more tests
sandreae Mar 11, 2023
3cb0fc7
fmt
sandreae Mar 11, 2023
cc444b3
WIP: relation fields
sandreae Mar 12, 2023
9af17c2
WIP: field recursion
sandreae Mar 12, 2023
e164b36
WIP: relation fields
sandreae Mar 13, 2023
eab8ccc
WIP: still relations...
sandreae Mar 13, 2023
de04b5c
Finally understand how relation lists are handled
sandreae Mar 13, 2023
ffac34e
Clippy
sandreae Mar 13, 2023
0341e12
Add more comments
sandreae Mar 13, 2023
43c1f28
Don't pass doc id's
sandreae Mar 13, 2023
6122e2d
Bring back tests
sandreae Mar 13, 2023
f4ca52c
fmt
sandreae Mar 13, 2023
a146fd6
Introduce all documents by schema query
sandreae Mar 14, 2023
785552c
Add const values for all string identifiers
sandreae Mar 14, 2023
273d0df
Some clippy happiness
sandreae Mar 14, 2023
23ec9ee
fmt
sandreae Mar 14, 2023
895c1d1
All the tests pass
sandreae Mar 14, 2023
712b9fa
Add dash prefix to unused payload item on entry
sandreae Mar 14, 2023
b02bcb9
Add logging
sandreae Mar 14, 2023
2dde620
Correct next args description
sandreae Mar 14, 2023
3db4b6d
Slight description tidy-up
sandreae Mar 14, 2023
97231a9
Clippy
sandreae Mar 14, 2023
f15b92e
Remove use of serial tests as no longer needed
sandreae Mar 14, 2023
3782e8d
Move consts to own module and add doc strings.
sandreae Mar 15, 2023
8805769
remove todos
sandreae Mar 15, 2023
30cfa2b
remove todos
sandreae Mar 15, 2023
6e602fd
Add tests for passing too many/few args
sandreae Mar 15, 2023
3178d8c
Correct encoded entry spelling
adzialocha Mar 16, 2023
ce3d3d5
Minor comment changes, add license header
adzialocha Mar 16, 2023
78dd30e
Use dynamic-graphql crate from registry
adzialocha Mar 16, 2023
dda02a8
Add comment about unwrapping
adzialocha Mar 16, 2023
05a751e
Names in programming are funny
adzialocha Mar 16, 2023
82b41ee
Add more docstring, clarify endpoint terminology
adzialocha Mar 16, 2023
d749105
Change constants module exports
adzialocha Mar 16, 2023
32993b7
Clarify panic when trying to use a relation type
adzialocha Mar 16, 2023
0bed183
Remove print
adzialocha Mar 16, 2023
e336758
Run cargo fmt
adzialocha Mar 16, 2023
e5161fc
Merge branch 'main' into async-graphql-dynamic-schema
adzialocha Mar 16, 2023
34bc113
Fix API changes
adzialocha Mar 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
679 changes: 323 additions & 356 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions aquadoggo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ edition = "2018"

[dependencies]
anyhow = "^1.0.62"
async-graphql = "^3.0.38"
async-graphql-axum = "^3.0.38"
async-graphql = { version = "^5.0.6", features = ["dynamic-schema"] }
async-graphql-axum = "^5.0.6"
async-recursion = "^1.0.0"
async-trait = "^0.1.64"
axum = "^0.5.15"
axum = "^0.6.10"
bamboo-rs-core-ed25519-yasmf = "^0.1.1"
deadqueue = { version = "^0.2.3", default-features = false, features = [
"unlimited",
] }
directories = "^4.0.1"
dynamic-graphql = "^0.7.1"
envy = "^0.4.2"
futures = "^0.3.23"
gql_client = "^1.0.6"
Expand Down Expand Up @@ -85,7 +86,6 @@ reqwest = { version = "^0.11.11", default-features = false, features = [
rstest = "^0.15.0"
rstest_reuse = "^0.3.0"
serde_json = "^1.0.85"
serial_test = "1.0.0"
tempfile = "^3.4.0"
tower = "^0.4.13"
tower-service = "^0.3.2"
6 changes: 3 additions & 3 deletions aquadoggo/src/db/stores/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ mod tests {
assert_eq!(encoded_entry.hash(), retrieved_entry.hash());
assert_eq!(
encoded_operation,
retrieved_entry.payload().unwrap().to_owned()
retrieved_entry._payload().unwrap().to_owned()
adzialocha marked this conversation as resolved.
Show resolved Hide resolved
);
assert_eq!(retrieved_entry.encoded_entry, encoded_entry);
});
Expand Down Expand Up @@ -399,15 +399,15 @@ mod tests {

// Construct a new entry from it with the same values.
let entry = EntryBuilder::new()
.sign(first_entry.payload().unwrap(), key_pair)
.sign(first_entry._payload().unwrap(), key_pair)
.unwrap();

// We try to publish it again which should error as entry hashes
// have a unique constraint.
let result = node
.context
.store
.insert_entry(&entry, &first_entry.encoded_entry, first_entry.payload())
.insert_entry(&entry, &first_entry.encoded_entry, first_entry._payload())
.await;

assert!(result.is_err());
Expand Down
2 changes: 1 addition & 1 deletion aquadoggo/src/db/types/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct StorageEntry {
}

impl StorageEntry {
pub fn payload(&self) -> Option<&EncodedOperation> {
pub fn _payload(&self) -> Option<&EncodedOperation> {
self.payload.as_ref()
}
}
Expand Down
Loading