Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Conversation

dmytro-ch
Copy link
Contributor

@dmytro-ch dmytro-ch commented Mar 24, 2019

This PR is a:

  • New topic
  • Content update
  • Content fix or rewrite
  • Bug fix or improvement

Summary

This PR adds information about debugging GraphQL queries.
The new page is created and the corresponding link is added into the Development section of navigation menu.

Additional information

List all affected URLs

  • graphql/develop/debugging.html

whatsnew
Added a topic about GraphQL debugging.

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Mar 24, 2019

CLA assistant check
All committers have signed the CLA.

@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

@lorikrell lorikrell changed the title [GaphQL] Add information about debugging [GraphQL] Add information about debugging Mar 26, 2019
@keharper keharper self-assigned this Mar 30, 2019
@keharper keharper added 2.3.x Magento 2.3 related changes New Topic A major update published as an entirely new document labels Mar 30, 2019
title: Debugging GraphQL queries
---

In this section you will find recommendations on how to debug GraphQL requests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In this section you will find recommendations on how to debug GraphQL requests.
This topic provides recommendations on how to debug GraphQL requests.


## Debugging with PHPStorm and Xdebug

When [using GraphiQL]({{ page.baseurl }}/graphql/index.html#how-to-access-graphql) or any other client for testing GraphQL queries you might need to debug the request processing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
When [using GraphiQL]({{ page.baseurl }}/graphql/index.html#how-to-access-graphql) or any other client for testing GraphQL queries you might need to debug the request processing.
When [using GraphiQL]({{ page.baseurl }}/graphql/index.html#how-to-access-graphql) or any other client for testing GraphQL queries, you might need to debug the request processing.

## Debugging with PHPStorm and Xdebug

When [using GraphiQL]({{ page.baseurl }}/graphql/index.html#how-to-access-graphql) or any other client for testing GraphQL queries you might need to debug the request processing.
It is possible to use Xdebug for debugging the PHP execution of GraphQL query as well as we do for other HTTP requests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
It is possible to use Xdebug for debugging the PHP execution of GraphQL query as well as we do for other HTTP requests.
You can use Xdebug for debugging the PHP execution of a GraphQL query just as you would for other HTTP requests.


When [using GraphiQL]({{ page.baseurl }}/graphql/index.html#how-to-access-graphql) or any other client for testing GraphQL queries you might need to debug the request processing.
It is possible to use Xdebug for debugging the PHP execution of GraphQL query as well as we do for other HTTP requests.
In order to start debugging you can simply add the additional `?XDEBUG_SESSION_START=PHPSTORM` parameter to the endpoint url.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In order to start debugging you can simply add the additional `?XDEBUG_SESSION_START=PHPSTORM` parameter to the endpoint url.
To start debugging, add the `?XDEBUG_SESSION_START=PHPSTORM` parameter to the endpoint URL.

When [using GraphiQL]({{ page.baseurl }}/graphql/index.html#how-to-access-graphql) or any other client for testing GraphQL queries you might need to debug the request processing.
It is possible to use Xdebug for debugging the PHP execution of GraphQL query as well as we do for other HTTP requests.
In order to start debugging you can simply add the additional `?XDEBUG_SESSION_START=PHPSTORM` parameter to the endpoint url.
The following example shows how to establish connection between Xdebug and PHPStorm IDE.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The following example shows how to establish connection between Xdebug and PHPStorm IDE.
The following example shows how to establish a connection between Xdebug and PHPStorm IDE.

http://<magento2-3-server>/graphql?XDEBUG_SESSION_START=PHPSTORM
```

There is also another possible way to enable Xdebug connection for particular request by setting the corresponding header parameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
There is also another possible way to enable Xdebug connection for particular request by setting the corresponding header parameter.
You can also enable an Xdebug connection for a particular request by setting the corresponding header parameter.

Cookie: XDEBUG_SESSION=PHPSTORM
```

As result Xdebug within the PHP execution attempts to make a connection to an IDE. If the IDE is listening, it will give the instructions to Xdebug about breakpoints etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
As result Xdebug within the PHP execution attempts to make a connection to an IDE. If the IDE is listening, it will give the instructions to Xdebug about breakpoints etc.
As a result, Xdebug within the PHP execution attempts to make a connection to an IDE. If the IDE is listening, it will give the instructions to Xdebug about breakpoints and other relevant information.

@dmytro-ch
Copy link
Contributor Author

Hello @keharper,
thank you for reviewing this pull request.
I've applied the changes according to the recommendations.

Thank you!

@keharper
Copy link
Contributor

keharper commented Apr 3, 2019

running tests

@keharper keharper merged commit 5e8ba6f into magento:master Apr 3, 2019
@ghost
Copy link

ghost commented Apr 3, 2019

Hi @dmytro-ch, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@keharper
Copy link
Contributor

keharper commented Apr 3, 2019

Thanks for your contribution, @dmytro-ch

@dshevtsov
Copy link
Collaborator

@keharper please add whatsnew

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.3.x Magento 2.3 related changes New Topic A major update published as an entirely new document Partner: Atwix partners-contribution PR created by Magento partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants