This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
Write CONTRIBUTING.md that would have helped me #250
Merged
johnymontana
merged 2 commits into
neo4j-graphql:master
from
roschaefer:248-add_contribution_guidelines
Jul 8, 2019
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Contributing | ||
|
||
Thanks so much for thinking of contributing to `neo4j-graphql-js`, we really | ||
appreciate it! :heart: | ||
|
||
## Get in Touch | ||
|
||
There's an active [mailing list](https://groups.google.com/forum/#!forum/neo4j) | ||
and [Slack channel](https://neo4j.com/slack) where we work directly with the | ||
community. | ||
If you're not already a member, sign up! | ||
|
||
We love our community and wouldn't be where we are without you. | ||
|
||
## Getting Set Up | ||
|
||
Clone the repository, install dependencies and build the project: | ||
|
||
``` | ||
git clone [email protected]:neo4j-graphql/neo4j-graphql-js.git | ||
cd neo4j-graphql-js | ||
npm install | ||
npm run build | ||
``` | ||
|
||
### Testing | ||
|
||
We use the `ava` test runner. Run the tests with: | ||
|
||
``` | ||
npm run test | ||
``` | ||
|
||
The `npm test` script will run unit tests that check GraphQL -> Cypher | ||
translation and the schema augmentation features and can be easily run locally | ||
without any extra dependencies. | ||
|
||
Full integration tests can be found in `/test` and are | ||
[run on CircleCI](https://circleci.com/gh/neo4j-graphql/neo4j-graphql-js) as | ||
part of the CI process. | ||
|
||
#### Integration Testing | ||
|
||
If you want to run integration tests locally, make sure your setup meets the | ||
following requirements: | ||
|
||
- A local Neo4J instance with username `neo4j` and password `letmein` | ||
- Your Neo4J instance runs on [this database](https://s3.amazonaws.com/neo4j-sandbox-usecase-datastores/v3_5/recommendations.db.zip) | ||
|
||
In order to import the database, you can download the zipped files and extract | ||
it to the databases folder of your Neo4J instance. Restart the database on the | ||
new data. | ||
|
||
Once you're done with that: | ||
|
||
``` | ||
npm run start-middleware | ||
# open another terminal and run | ||
npm run parse-tck | ||
npm run test-all | ||
``` | ||
|
||
### Local Development | ||
|
||
If you include this library inside your project and you want point the | ||
dependency to the files on your local machine, you will probably run into the | ||
following error: | ||
|
||
``` | ||
Error: Cannot use GraphQLObjectType "Query" from another module or realm. | ||
|
||
Ensure that there is only one instance of "graphql" in the node_modules | ||
directory. If different versions of "graphql" are the dependencies of other | ||
relied on modules, use "resolutions" to ensure only one version is installed. | ||
``` | ||
|
||
This is because we currently don't have `graphql` as a peer dependency. See if | ||
[this issue](https://github.com/neo4j-graphql/neo4j-graphql-js/issues/249) still | ||
exists. Until this is fixed a possible workaround is to overwrite the target | ||
folder of `npm run build`. | ||
|
||
Open `package.json` and simply replace `dist/` with the path to the | ||
`node_modules/` folder of your project: | ||
|
||
``` | ||
{ | ||
... | ||
"scripts": { | ||
... | ||
"build": "babel src --presets babel-preset-env --out-dir /path/to/your/projects/node_modules/", | ||
.. | ||
} | ||
.. | ||
} | ||
|
||
``` | ||
|
||
If you run `npm run build` now, it will be build right into your project and you | ||
should not face the error above. | ||
|
||
## Spread the love | ||
|
||
If you want to merge back your changes into the main repository, it would be | ||
best if you could [fork the repository](https://help.github.com/en/articles/fork-a-repo) | ||
on Github. Add the fork as a separate remote, push your branch and create a pull | ||
request: | ||
|
||
```sh | ||
git remote add your-fork [email protected]:your-username/neo4j-graphql-js.git | ||
git push your-fork your-branch | ||
# now go to Github and create a pull request | ||
``` | ||
|
||
We :heart: you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@johnymontana thank you for providing the file. Could you upload a dump of your database to
s3.amazonaws.com..
?We could improve the documentation here and use
neo4j-admin load ...
.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.
By now I would prefer to check the file into version control. Opinions?
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.
I'd prefer not to check the datastore into git. Let's plan for a long term goal of refactoring the tests to use Cypher script fixtures rather than loading the datastore.
In the meantime a
.dump
version of the datastore is available here: https://s3-us-west-2.amazonaws.com/neo4j-datasets-public/recommendations.dump