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

docs(env-variables): Add cURL example for refresh endpoint #10829

Merged

Conversation

riddla
Copy link
Contributor

@riddla riddla commented Jan 4, 2019

Description

I added a cURL example for the refresh endpoint e.g. http://localhost:8000/__refresh.

Related Issues

Related to #10328.

@riddla riddla requested a review from a team January 4, 2019 14:48
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

Left a small comment; not sure if it's worth documenting but we want to avoid confusion wherever we can.

I'll leave it up to you!

docs/docs/environment-variables.md Outdated Show resolved Hide resolved
Co-Authored-By: riddla <volker.rose@gmail.com>
@riddla
Copy link
Contributor Author

riddla commented Jan 5, 2019

Thanks for the addition. Makes totally sense.

@calcsam calcsam merged commit 8f56b04 into gatsbyjs:master Jan 5, 2019
@gatsbot
Copy link

gatsbot bot commented Jan 5, 2019

Holy buckets, @riddla — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

@riddla
Copy link
Contributor Author

riddla commented Jan 7, 2019

@DSchau, I was wondering if a small helper component like the following would/could make sense, also for others:

import React from 'react'

let style = {
  // ...
}

const RefreshContent = ({ children }) => (
  <button onClick={refresh} style={style}>
    Refresh content
  </button>
)

function refresh() {
  console.log('refreshing content')
  var oReq = new XMLHttpRequest()
  oReq.open('POST', 'http://localhost:8000/__refresh')
  oReq.send()
}

export default RefreshContent

As I'm new to the Gatsby ecosystem I don't know if those kind of (development) helper components already exist, where I could put them etc.
Maybe you have some insights?

gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
…10829)

<!--
  Have any questions? Check out the contributing docs at https://gatsby.app/contribute, or
  ask in this Pull Request and a Gatsby maintainer will be happy to help :)
-->

## Description

I added a cURL example for the refresh endpoint e.g. http://localhost:8000/__refresh.

## Related Issues

Related to gatsbyjs#10328.
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.

3 participants