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

Add steps to add custom resolver to README #16

Merged
merged 2 commits into from
Dec 14, 2017
Merged

Add steps to add custom resolver to README #16

merged 2 commits into from
Dec 14, 2017

Conversation

divyenduz
Copy link
Contributor

Closes #15

Please let me know if any changes are needed.

Closes #15

Please let me know if any changes are needed.
README.md Outdated
@@ -69,6 +69,33 @@ yarn playground
- [`/src/index.ts`](https://github.com/graphcool/graphql-boilerplate/blob/master/src/index.ts) is the entry point of your application, pulling everything together and starting the [`graphql-yoga`](https://github.com/graphcool/graphql-yoga) Server.
- [`/src/resolvers/`](https://github.com/graphcool/graphql-boilerplate/tree/master/src/resolvers) includes the actual business logic of your application. In GraphQL you implement [resolvers](http://graphql.org/learn/execution/) that *resolve* a specific query being requested

### Next Steps
#### Adding a custom resolver
Suppose we want to add a custom resolver to delete a post (example). We can take the following steps:-
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer

Suppose we want to add a custom resolver to delete a post. We can take the following steps:

README.md Outdated
#### Adding a custom resolver
Suppose we want to add a custom resolver to delete a post (example). We can take the following steps:-

Add `delete` field to the Mutation type in `src/schema.graphql`
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer

Add a new delete field to the Mutation type in src/schema.graphql

README.md Outdated
}
```

Add `delete` resolver to Mutation part of `src/index.js`
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer

Add a delete resolver to Mutation part of src/index.js

```

Run `yarn start`

Copy link
Contributor

@marktani marktani Dec 14, 2017

Choose a reason for hiding this comment

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

Add the example how to delete a post:

mutation {
  delete(id: "cuid") {
    id
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose you mean, how to delete a post? Made the required changes. Let me know if anything else needed :)

@marktani marktani merged commit 3ad7ac1 into graphql-boilerplates:master Dec 14, 2017
@marktani
Copy link
Contributor

Thanks 🙌

@marktani
Copy link
Contributor

For now, I am collecting common scenarios in this issue instead: #35. I moved your descriptions there, as well.

Once we collected a few and the READMEs of the individual boilerplates have been reorganized, we can add them back in where appropriate 🙂

@divyenduz
Copy link
Contributor Author

Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants