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

Mark code in data-fetching.md #1177

Merged

Conversation

hippotastic
Copy link
Contributor

What kind of changes does this PR include?

  • New or updated content

Description

  • Uses our new code snippet inline marking feature to highlight important parts of the code blocks.

@netlify
Copy link

netlify bot commented Aug 3, 2022

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8e6a5b6
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/62ea75af614f2300084e2471
😎 Deploy Preview https://deploy-preview-1177--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -38,11 +38,11 @@ const randomUser = data.results[0]

Astro can also use `fetch()` to query a GraphQL server with any valid GraphQL query.

```astro title="src/components/Weather.astro"
```astro title="src/components/Weather.astro" "await fetch"
Copy link
Member

Choose a reason for hiding this comment

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

To make it more consistent across the page I thought the graphql code block can also highlight the URL. I would suggest something but my regex is very bad 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I stopped there is because the actual end of the GraphQL fetch call is waaaay further down and I didn't want to highlight the entire block as it seemed too much. 😄

My logic was: If I did highlight function arguments, I'd have to highlight them all in order not to mislead people. And because the arguments were too long I chose not to.

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 agree that it looks inconsistent though! It's just that the other options appear to be worse. 😅

Copy link
Member

Choose a reason for hiding this comment

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

I see. I guess the way I saw it by highlighting the URL is saying pretty much "hey we are fetching from a graphql endpoint"

I agree that highlighting the entire function call is too much 😅. I am good with both options ✅

@hippotastic hippotastic merged commit 136e077 into withastro:main Aug 3, 2022
@hippotastic hippotastic deleted the hippotastic/unacceptable-goldfish branch August 4, 2022 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants