You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Automation using husky](#automation-using-husky)
27
+
-[Pre-Commit hook](#pre-commit-hook)
28
+
-[Post-Merge hook](#post-merge-hook)
29
+
-[GraphQL Voyager](#graphql-voyager)
30
+
-[Running Queries with talawa-api](#running-queries-with-talawa-api)
28
31
-[Internships](#internships)
29
32
-[Community](#community)
30
33
@@ -77,7 +80,7 @@ When multiple developers are working on issues there is bound to be a conflict o
77
80
- In the cases where you feel your potential issues could be an extension or in conflict with other PRs it is important to ask the author of the PR in the slack channel or in their PRs or issues themselves why he/she did not write code for something that would require minimal effort on their part.
78
81
- Based on basic courtesy, it is good practice to let the person who created a function apply and test that function when needed.
79
82
- Last but not the least, communication is important make sure to talk to other contributors, in these cases, in slack channel or in a issue/PR thread.
80
-
- As a last resort the Admins would be responsible for deciding how to resolve this conflict.
83
+
- As a last resort the Admins would be responsible for deciding how to resolve this conflict.
81
84
82
85
### Contributing Code
83
86
@@ -141,11 +144,13 @@ The process of proposing a change to Talawa API can be summarized as:
141
144
13. Review and address comments on your pull request if requested.
142
145
143
146
## Upgrading Code
144
-
Before you start contributing to the repository, you `ALWAYS` need to make sure that your code is up to date with the source repository at `PalisadoesFoundation/talawa-api`.
147
+
148
+
Before you start contributing to the repository, you `ALWAYS` need to make sure that your code is up to date with the source repository at `PalisadoesFoundation/talawa-api`.
145
149
146
150
To do we will help you setup an upstream and origin for your repository, which will help you contribute code with great ease:-
147
151
148
152
#### Setting up Upstream and Origin
153
+
149
154
After cloning your forked repository, your origin remote is pointing to your fork (`{{GITHUB USERNAME}}/talawa-api`). To stay up to date with the main `PalisadoesFoundation/talawa-api` repository, add it as a remote called upstream. You'll first need to move into the `talawa-api` directory that was created by the clone operation.
150
155
151
156
```
@@ -167,19 +172,22 @@ We have established a clean setup now. We can make any changes we like and push
167
172

168
173
169
174
#### Creating a Pull Request - Process Overview
170
-
For making any changes to original repository, we first sync our cloned repository with original repository. We merge `develop` with `upstream/develop` to do this.
175
+
176
+
For making any changes to original repository, we first sync our cloned repository with original repository. We merge `develop` with `upstream/develop` to do this.
171
177
This make sometimes require a hard reset, and can be done with the following commands:
178
+
172
179
```
173
180
git fetch upstream
174
181
git reset upstream/develop --hard
175
182
```
176
-
Now we make a new branch (with `git checkout -b {{ BRANCH_NAME }}` ), do the changes on the branch, add and commit them (with `git add . && git commit -m {{ COMMIT_MESSAGE }}` ), push the branch to forked repository (with `git push origin {{ BRANCH_NAME }} --force` ), and make a PR from Github interface (from our new branch to the `develop` branch of `PalisadoesFoundation/talawa-api` s).
183
+
184
+
Now we make a new branch (with `git checkout -b {{ BRANCH_NAME }}` ), do the changes on the branch, add and commit them (with `git add . && git commit -m {{ COMMIT_MESSAGE }}` ), push the branch to forked repository (with `git push origin {{ BRANCH_NAME }} --force` ), and make a PR from Github interface (from our new branch to the `develop` branch of `PalisadoesFoundation/talawa-api` s).
177
185
178
186
We use a different branch to make changes so that we can work on multiple issues while still having a clean version in develop branch.
179
187
180
188
## Type checking and code quality
181
189
182
-
On making a PR, we use GitHub actions to check that your code is properly formatted, doesn't have typescript type errors and is properly linted. Here are the checks:-
190
+
On making a PR, we use GitHub actions to check that your code is properly formatted, doesn't have typescript type errors and is properly linted. Here are the checks:-
183
191
184
192
<br/>
185
193
@@ -204,11 +212,11 @@ We make use of `eslint` to enforce a strict linting convention in code.
204
212
To check code for linting issues use this command:-
205
213
206
214
npm run lint:check
207
-
215
+
208
216
To check and fix lint errors in code use this command:-
209
217
210
218
npm run lint:fix
211
-
219
+
212
220
Eslint might throw lint errors even after running the `lint:fix` command as those lint errors require manual intervention to be fixed. You have to fix those lint errors manually.
213
221
214
222
<br/>
@@ -237,35 +245,41 @@ We are using the package `Husky` to run git hooks that run according to differen
237
245
238
246
<br/>
239
247
240
-
#### pre-commit hook
241
-
We run a pre-commit hook which automatically runs code quality checks each time you make a commit and also fixes some of the issues. This way you don't have to run them manually each time.
248
+
#### Pre-Commit hook
242
249
250
+
We run a pre-commit hook which automatically runs code quality checks each time you make a commit and also fixes some of the issues. This way you don't have to run them manually each time.
243
251
244
252
If you don't want these pre-commit checks running on each commit, you can manually opt out of it using the `--no-verify` flag with your commit message as shown:-
245
253
246
254
git commit -m "commit message" --no-verify
247
255
248
256
<br/>
249
257
250
-
251
-
#### post-merge hook
258
+
#### Post-Merge hook
252
259
253
260
We are also running a post-merge(post-pull) hook which will automatically run "npm install" only if there is any change made to pakage.json file so that the developer has all the required dependencies when pulling files from remote.
254
261
255
-
256
262
If you don't want this hook to run, you can manually opt out of this using the `no verify` flag while using the merge command(git pull):
257
263
258
-
git pull --no-verify
264
+
git pull --no-verify
259
265
260
266
<br/>
261
267
262
-
268
+
### GraphQL Voyager
269
+
270
+
We use the open source project [GraphQL Voyager](https://github.com/IvanGoncharov/graphql-voyager) to help you interact and explore the complete schema in an interactive manner!
271
+
272
+
Go to `http://localhost:4000/voyager` after running the development server to explore the same!
273
+
274
+

275
+
263
276
### Running Queries with talawa-api
264
-
- Talawa API currently implement `GraphQL Playground` as mediator interface to run and test queries directly from the api. [Learn more](https://www.apollographql.com/docs/apollo-server/v2/testing/graphql-playground/)
265
-
- In development, Apollo Server enables GraphQL Playground on the same URL as the GraphQL server itself (e.g. http://localhost:4000/graphql) and automatically serves the GUI to web browsers. When NODE_ENV is set to production, GraphQL Playground (as well as introspection) is disabled as a production best-practice.
- Talawa API currently implement `GraphQL Playground` as mediator interface to run and test queries directly from the api. [Learn more](https://www.apollographql.com/docs/apollo-server/v2/testing/graphql-playground/)
279
+
- In development, Apollo Server enables GraphQL Playground on the same URL as the GraphQL server itself (e.g. http://localhost:4000/graphql) and automatically serves the GUI to web browsers. When NODE_ENV is set to production, GraphQL Playground (as well as introspection) is disabled as a production best-practice.
- Note: To access the playground in talawa API append the URL with "/graphql"
268
-
282
+
269
283
## Internships
270
284
271
285
If you are participating in any of the various internship programs we ar members of then please read the [introduction guides on our documentation website](https://docs.talawa.io/docs/).
0 commit comments