martin-888 / graphql-prettier Goto Github PK
View Code? Open in Web Editor NEWPrettify & simplify GraphQL query/mutation/subscription.
License: MIT License
Prettify & simplify GraphQL query/mutation/subscription.
License: MIT License
query Hello {
__typename
# History
histories(find: {end: "", id: "", start: ""}, limit: 10, order: "") {
event_date_utc
flight {
details
id
}
}
}
query Hello {
__typename
histories(find: {end: "", id: "", start: ""}, limit: 10, order: "") {
event_date_utc
flight {
details
id
}
}
}
query ( $ids: [String!] $idSize: Int $size: Int $from: Int $name: String $state: String ) { login { id devices(size: $size, from: $from, name: $name, state: $state) { total items { id name state created lastReported hardwareId endpoint { externalAddress internalAddress availability instability geo { connectionType countryName stateName city isp } } owner { id email } services { id name state created lastReported port type access { user { email } } sessions { timestamp endpoint { platform } user { id email } } } } } connections: devices(id: $ids, size: $idSize) { total items { id name state created lastReported hardwareId endpoint { externalAddress internalAddress availability instability geo { connectionType countryName stateName city isp } } owner { id email } services { id name state created lastReported port type access { user { email } } sessions { timestamp endpoint { platform } user { id email } } } } } } }
stack trace:
TypeError: Cannot read properties of undefined (reading 'value')
src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/[index.js](https://github.com/remoteit/serverless-test/tree/master/src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/index.js#L60):60:1 in findIndex src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/[index.js](https://github.com/remoteit/serverless-test/tree/master/src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/index.js#L73):73:1 src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/[index.js](https://github.com/remoteit/serverless-test/tree/master/src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/index.js#L72):72:1 src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/[index.js](https://github.com/remoteit/serverless-test/tree/master/src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/index.js#L63):63:1 in mergeDuplicatedNotLeafNodes src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/[index.js](https://github.com/remoteit/serverless-test/tree/master/src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/index.js#L148):148:1 src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/[index.js](https://github.com/remoteit/serverless-test/tree/master/src/api/webpack:/graphql-api/node_modules/graphql-prettier/lib/index.js#L147):147:1
If there is a bunch of variables then It looks like a very complex query, Is it possible to format the variables too while prettifying?
query Hello {
__typename
histories(find: {end: "", id: "", start: ""}, limit: 10, order: "") {
event_date_utc
flight {
details
id
}
}
}
query Hello {
__typename
histories(
find: {
end: "",
id: "",
start: ""
},
limit: 10,
order: ""
) {
event_date_utc
flight {
details
id
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.