-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feat: Herbarium - Use it to create mutations, queries and types #54
Conversation
request: { | ||
arrayField: [CoolEntity], | ||
}, | ||
|
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.
remove this blank line, please
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.
fixed
request: { | ||
id: Number, | ||
}, | ||
|
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 too
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.
fixed
awesome PR @PedroMarquesFr , thank you very much! |
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 14 +1
Lines 173 192 +19
=========================================
+ Hits 173 192 +19
Continue to review full report at Codecov.
|
README.md
Outdated
@@ -149,6 +149,16 @@ const [gql, resolver] = usecase2mutation(usecase, resolverFunc) | |||
``` | |||
| |||
Or you can use `herbs2gql` [`defaultResolver`](https://github.com/herbsjs/herbs2gql/blob/master/src/defaultResolver.js) implementation as a reference. | |||
|
|||
### Herbarium integration |
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.
Herbarium integration
Since this kind of integration will be the primary way of converting Herbs to GraphQL, this should be the first method to show, not the last
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.
make sense, fixed
src/herbs2gql.js
Outdated
@@ -7,4 +7,5 @@ module.exports = { | |||
defaultResolver: require('./defaultResolver'), | |||
defaultErrorHandler: require('./defaultErrorHandler').defaultErrorHandler, | |||
args2request: require('./args2request'), | |||
herbarium2gql:require('./herbarium2gql') |
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.
herbarium2gql
-> herbs2gql
The idea is that Herbarium is not the important part here, it is just part of Herbs
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.
ok
@PedroMarquesFr thank you for this PR. It is on the right path! |
package.json
Outdated
@@ -34,6 +34,7 @@ | |||
"license": "MIT", | |||
"homepage": "https://github.com/herbsjs/herbs2gql#readme", | |||
"dependencies": { | |||
"@herbsjs/herbarium": "^1.4.0", |
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.
shouldn't be put on "peerDependencies"?
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.
true I didn't noticed
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.
fixed
when I look at the To Do List project, there it is possible to find custom mutations and queries - here in this format with herbarium, how would this scenario of custom mutations and queries look like? |
As mutations, queries and types array struture didnt change it would work the same way, using push method, but all in the index file and not on each individual file. Example using quoted To Do List project: |
I think now the CI is working, can you run it again please @jhomarolo ? |
@PedroMarquesFr the PR is read to merge but it seems the test coverage has dropped. Can you check it? |
It seems that have some "it.only" inside the test suite. @PedroMarquesFr could you please remove them? |
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Created herbarium support to herbs2gql
Fixes #38
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance