Skip to content

Commit

Permalink
fix: add Content-Type if protocol GRAPHQL (AnWeber/vscode-httpyac#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnWeber committed Jan 31, 2024
1 parent cf8557c commit ae86719
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 100 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## [unreleased]
## [6.11.2] (2023-01-31)

### Fix
- hide password answer in sessionStore (AnWeber/httpbook#111)
- add Content-Type if protocol `GRAPHQL` is used to support same API as Intellij HTTP Client (AnWeber/vscode-httpyac#257)

## [6.11.1] (2023-01-14)

Expand Down
181 changes: 85 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"publisher": "AnWeber",
"description": "HTTP/REST CLI Client for *.http files",
"version": "6.11.1",
"version": "6.11.2",
"homepage": "https://github.com/AnWeber/httpyac",
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/graphql/graphqlProtocolReplacer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { graphqlProtocolReplacer } from './graphqlProtocolReplacer';

describe('graphqlProtocolReplacer', () => {
it('should return POST', async () => {
const request: models.Request = { method: 'graphql' };
const request: models.Request = { url: '', method: 'graphql' };
await graphqlProtocolReplacer(request);
expect(request.method).toEqual('POST');
expect(request.headers?.['content-type']).toEqual('application/json');
});
it('should not change', async () => {
const request: models.Request = { method: 'get' };
const request: models.Request = { url: '', method: 'get' };
await graphqlProtocolReplacer(request);
expect(request.method).toEqual('get');
});
Expand Down
Loading

0 comments on commit ae86719

Please sign in to comment.