-
Notifications
You must be signed in to change notification settings - Fork 85
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 a simple page to list a few products from a GraphQL query. #27
Conversation
1c1987e
to
b4e103f
Compare
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.
This is looking amazing, great job!
resources/js/react/App.jsx
Outdated
return ( | ||
<h1>Hello React</h1> | ||
<AppProvider i18n={translations}> |
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 think if you use <Provider>
from app-bridge-react
, you'll get the styling automatically so you don't have to directly include the CSS.
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 added <Provider>
but I still had to include the css, this is being done in the node app as well
@@ -112,7 +112,7 @@ | |||
|
|||
Route::post('/graphql', function (Request $request) { | |||
$result = Utils::graphqlProxy($request->header(), $request->cookie(), $request->getContent()); | |||
return response($result->getDecodedBody())->withHeaders($result->getHeaders()); | |||
return response($result->getDecodedBody()); |
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.
If simply passing along all the headers doesn't work, we could come up with a list of the ones we want to set and go over the list here.
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.
Yes, that's a good idea, I wasn't sure though what would be those ones. I will check the issue with the headers separately. Thought of putting it aside given that we do not using it right now.
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.
Agreed! Though we probably also want to make sure to forward the response code we got back!
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.
Good point, let me have those two points in a different PR
9fcee09
to
3585f40
Compare
resources/js/react/App.jsx
Outdated
const config = {apiKey: apiKey, shopOrigin: shop, host: host}; | ||
|
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.
Sorry, I failed to see this before, but the call to createApp
below can also be replaced by const app = useAppBridge();
from app-bridge-react.
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.
Done 👍
3585f40
to
35fee18
Compare
35fee18
to
8204174
Compare
8204174
to
32edac0
Compare
WHY are these changes introduced?
Add a very simple page to list a few products from a GraphQL query, to demonstrate how to load a session / use it for requests.
WHAT is this pull request doing?
Checklist