Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Add params tables for GraphQL and Rest Client docs. #123

Merged
merged 5 commits into from
Mar 8, 2021

Conversation

thecodepixi
Copy link
Contributor

@thecodepixi thecodepixi commented Mar 4, 2021

WHY are these changes introduced?

Partially fixes 121

Strikethru the above to keep docs issue open, but this does partially resolve some of the needed docs enhancement outlined in that issue.

WHAT is this pull request doing?

Adds the necessary tables to explain the available params and arguments for the GraphQL and Rest clients, as well as general improvements to the usage examples.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
    - [ ] Minor: New feature (non-breaking change which adds functionality)
    - [ ] Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
    - [ ] I have added/updated tests for this change
    - [ ] I have documented new APIs/updated the documentation for modified APIs (for public APIs)

docs/usage/rest.md Outdated Show resolved Hide resolved
@thecodepixi thecodepixi requested review from paulomarg and gfscott March 4, 2021 20:26
Copy link
Contributor

@gfscott gfscott left a comment

Choose a reason for hiding this comment

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

👍🏻 Looking good! Couple little notes and considerations

@@ -2,11 +2,21 @@

Once OAuth is complete, we can use the library's `GraphqlClient` to make requests to the GraphQL Admin API in a similar way. To do that, create an instance of `GraphqlClient` using the current shop URL and session `accessToken` in your app's endpoint.

The `GraphQLClient`'s main method is `query`, which accepts a `GraphQLParams` object as its argument. `GraphQLParams` only requires the `data` parameter, but also optionally accepts `query`, `extraHeaders`, and `tries`:

| Parameter | Type | Notes | Required? | Default Value |
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a good rule is to always put the "Notes" column last, since it's often the largest chunk and in some contexts might push more critical information (like "Required?") out of the user's view

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. Also, I'm always torn between having a required? column or having the parameters as data / query?

Copy link
Contributor Author

@thecodepixi thecodepixi Mar 5, 2021

Choose a reason for hiding this comment

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

@gfscott Oh that's a really good point, thank you! I'll shift that over.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@paulomarg Yeah I feel the same way. Is it obvious enough to just end the param name in a ? to mark it as optional? So few of the params are required it feels like a waste of table space. I actually feel the same way about the Default Value column, but want to communicate the default for tries in an obvious way.

docs/usage/graphql.md Outdated Show resolved Hide resolved
docs/usage/graphql.md Outdated Show resolved Hide resolved
docs/usage/rest.md Outdated Show resolved Hide resolved
docs/usage/rest.md Outdated Show resolved Hide resolved
Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

This is great!!!

@@ -2,11 +2,21 @@

Once OAuth is complete, we can use the library's `GraphqlClient` to make requests to the GraphQL Admin API in a similar way. To do that, create an instance of `GraphqlClient` using the current shop URL and session `accessToken` in your app's endpoint.

The `GraphQLClient`'s main method is `query`, which accepts a `GraphQLParams` object as its argument. `GraphQLParams` only requires the `data` parameter, but also optionally accepts `query`, `extraHeaders`, and `tries`:

| Parameter | Type | Notes | Required? | Default Value |
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. Also, I'm always torn between having a required? column or having the parameters as data / query?

docs/usage/rest.md Show resolved Hide resolved
docs/usage/rest.md Show resolved Hide resolved
@thecodepixi thecodepixi requested a review from paulomarg March 8, 2021 19:23
@thecodepixi thecodepixi changed the title [WIP] Adds params tables for GraphQL and Rest Client docs. Add params tables for GraphQL and Rest Client docs. Mar 8, 2021
@thecodepixi thecodepixi marked this pull request as ready for review March 8, 2021 19:28
@thecodepixi thecodepixi requested a review from a team as a code owner March 8, 2021 19:28
docs/usage/rest.md Outdated Show resolved Hide resolved
docs/usage/rest.md Outdated Show resolved Hide resolved
Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

LGTM

@thecodepixi thecodepixi force-pushed the documenation-improvements branch from c771fe5 to 96c3079 Compare March 8, 2021 21:35
@thecodepixi thecodepixi merged commit fe5ed54 into main Mar 8, 2021
@thecodepixi thecodepixi deleted the documenation-improvements branch March 8, 2021 21:39
@paulomarg paulomarg temporarily deployed to production March 16, 2021 17:41 Inactive
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants