Skip to content

Commit

Permalink
- remove old GraphiQL JavaScript
Browse files Browse the repository at this point in the history
- update docs with links to new JavaScript files
- remove reference to old JavaScript files from composer.json
- remove reference to old JavaScript files from codeception.dist.yml
  • Loading branch information
jasonbahl committed Mar 8, 2022
1 parent a8b7361 commit 6490368
Show file tree
Hide file tree
Showing 27 changed files with 3 additions and 12,539 deletions.
3 changes: 1 addition & 2 deletions codeception.dist.yml
Expand Up @@ -20,8 +20,7 @@ coverage:
exclude:
- wp-graphql.php
- vendor/*
- src/Admin/GraphiQL/app/*
- src/Admin/GraphiQL/js/*
- packages/*
show_only_summary: false
extensions:
enabled:
Expand Down
1 change: 0 additions & 1 deletion composer.json
Expand Up @@ -96,7 +96,6 @@
"*.yml",
"!vendor/",
"plugin-build/",
"!src/Admin/GraphiQL/app/",
"node_modules/",
"!.wordpress-org/",
"docs/",
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication.md
Expand Up @@ -27,7 +27,7 @@ For remote HTTP requests to the `/graphql` endpoint, existing authentication plu
- https://github.com/WP-API/OAuth1 (labeled for use with the WP REST API, but works well with WPGraphQL)
- https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/ (For WordPress 5.6 and above)

If the remote request is within the WordPress admin, such as the WPGraphiQL plugin, you can use the existing Auth nonce as seen in action [here](https://github.com/wp-graphql/wp-graphiql/blob/master/assets/app/src/App.js#L16-L29).
If the remote request is within the WordPress admin, such as the WPGraphiQL plugin, you can use the existing Auth nonce as seen in action [here](https://github.com/wp-graphql/wp-graphiql/blob/master/packages/graphiql-auth-switch).

For non-remote requests (PHP function calls), if the context of the request is already authenticated, such as an Admin page in the WordPress dashboard, existing WordPress authentication can be used, taking advantage of the existing session. For example, if you wanted to use a GraphQL query to populate a dashboard page, you could send your query to the `do_graphql_request( $query )` function, and since the request is already authenticated, GraphQL will execute with the current user set, and will resolve fields that the users has permission to resolve.

Expand Down
2 changes: 1 addition & 1 deletion docs/security.md
Expand Up @@ -59,7 +59,7 @@ For remote HTTP requests to the `/graphql` endpoint, existing authentication plu
- https://github.com/WP-API/Basic-Auth (even though it’s labeled for the REST API, it works well with WPGraphQL – but not recommended for non-SSL connections)
- https://github.com/WP-API/OAuth1 (labeled for use with the WP REST API, but works well with WPGraphQL)

If the remote request is within the WordPress admin, such as the WPGraphiQL plugin, you can use the existing Auth nonce as seen in action [here](https://github.com/wp-graphql/wp-graphiql/blob/master/assets/app/src/App.js#L16-L29).
If the remote request is within the WordPress admin, such as the WPGraphiQL plugin, you can use the existing Auth nonce as seen in action [here](https://github.com/wp-graphql/wp-graphiql/blob/master/packages/graphiql-auth-switch).

For non-remote requests (PHP function calls), if the context of the request is already authenticated, such as an Admin page in the WordPress dashboard, existing WordPress authentication can be used, taking advantage of the existing session. For example, if you wanted to use a GraphQL query to populate a dashboard page, you could send your query to the `do_graphql_request( $query )` function, and since the request is already authenticated, GraphQL will execute with the current user set, and will resolve fields that the users has permission to resolve.

Expand Down
19 changes: 0 additions & 19 deletions src/Admin/GraphiQL/app/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions src/Admin/GraphiQL/app/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions src/Admin/GraphiQL/app/build/asset-manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion src/Admin/GraphiQL/app/build/index.html

This file was deleted.

2 changes: 0 additions & 2 deletions src/Admin/GraphiQL/app/build/static/css/2.8d9709c7.chunk.css

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/Admin/GraphiQL/app/build/static/js/2.218c6839.chunk.js

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions src/Admin/GraphiQL/app/build/static/js/main.97617add.chunk.js

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 6490368

Please sign in to comment.