Skip to content

Commit

Permalink
chore: fix npm publish & add badges
Browse files Browse the repository at this point in the history
  • Loading branch information
cnwangjie committed Jul 3, 2023
1 parent 352acac commit e4cc560
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
!dist/**/*.js*
!types/**/*
!src/**/*
!package.json
!LICENSE
!README.md
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Normalize GraphQL Query

### Usage
[![Build](https://github.com/cnwangjie/normalize-graphql-query/actions/workflows/build.yaml/badge.svg)](https://github.com/cnwangjie/normalize-graphql-query/actions/workflows/build.yaml)
[![npm](https://img.shields.io/npm/v/normalize-graphql-query)](https://www.npmjs.com/package/normalize-graphql-query)

## Usage

**Apollo Server**

Expand Down Expand Up @@ -40,7 +43,7 @@ const response = await server.executeOperation(normalized)
const data = transformGraphQLResponse(normalized, response.data)
```

### Why you need it
## Why you need it

Consider you have a GraphQL API like this.

Expand Down Expand Up @@ -112,6 +115,6 @@ query task($id: ID!) {

You will get the same query if their structure is the same.

### License
## License

MIT License
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"name": "normalize-graphql-query",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "types/index.d.ts",
"files": [
"dist"
],
"repository": "https://github.com/cnwangjie/normalize-graphql-query.git",
"author": "Wang Jie <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const messUpVariables = (
for (const k in variables) {
const newKey = `_${crypto.randomBytes(8).toString('hex')}${k}`
messedUpVariables[newKey] = variables[k]
messedUpQuery = messedUpQuery.replaceAll(k, newKey)
messedUpQuery = messedUpQuery.replaceAll(`$${k}`, `$${newKey}`)
}

return {
Expand Down

0 comments on commit e4cc560

Please sign in to comment.