-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Mark code in data-fetching.md
#1177
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
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" |
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. 😅
There was a problem hiding this comment.
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 ✅
What kind of changes does this PR include?
Description