diff --git a/package-lock.json b/package-lock.json index 9be8a31..7c6ebfb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", - "graphql-editor-cli": "^0.9.3", + "graphql-editor-cli": "^0.9.4", "impuddle": "0.0.2", "prettier": "^2.7.1", "ttypescript": "^1.5.13", @@ -5221,7 +5221,7 @@ }, "packages/cli": { "name": "graphql-editor-cli", - "version": "0.9.3", + "version": "0.9.4", "license": "MIT", "dependencies": { "adm-zip": "^0.5.9", @@ -5283,8 +5283,11 @@ } }, "packages/sandbox": { - "version": "0.8.8", + "version": "0.8.9", "license": "MIT", + "dependencies": { + "graphql-editor-cli": "^0.9.4" + }, "devDependencies": {} } }, @@ -8509,7 +8512,10 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sandbox": { - "version": "file:packages/sandbox" + "version": "file:packages/sandbox", + "requires": { + "graphql-editor-cli": "^0.9.4" + } }, "semver": { "version": "7.6.0", diff --git a/package.json b/package.json index 2de5575..733ba6a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.2.1", - "graphql-editor-cli": "^0.9.3", + "graphql-editor-cli": "^0.9.4", "impuddle": "0.0.2", "prettier": "^2.7.1", "ttypescript": "^1.5.13", diff --git a/packages/cli/package.json b/packages/cli/package.json index 6da0197..0c38078 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "graphql-editor-cli", - "version": "0.9.3", + "version": "0.9.4", "description": "GraphQL -> anything. Use GraphQL as your source of truth. GraphQL Editor Official CLI.", "main": "lib/api.js", "author": "Artur Czemiel", diff --git a/packages/cli/src/gshared/constants/index.ts b/packages/cli/src/gshared/constants/index.ts index 39e5b8d..b734295 100644 --- a/packages/cli/src/gshared/constants/index.ts +++ b/packages/cli/src/gshared/constants/index.ts @@ -5,7 +5,7 @@ export const FAKER_DEPLOY_FILE = "faker.json"; export const ENDPOINT_CONFIGURATION_FILE = "cloudConfig.json"; export const JAMSTACK_CONFIG_FILE = "jamstack.json"; -export const IS_VERSION_FILE_REGEX = /^schema-(.*)\.json$/; +export const IS_VERSION_FILE_REGEX = /^schema-(.*)\.graphql$/; export const SLACK_JOIN = `https://discord.gg/wVcZdmd`; diff --git a/packages/sandbox/package.json b/packages/sandbox/package.json index a72ae25..f951c65 100644 --- a/packages/sandbox/package.json +++ b/packages/sandbox/package.json @@ -1,15 +1,16 @@ { "name": "sandbox", "private": true, - "version": "0.8.8", + "version": "0.8.9", "description": "GraphQL -> anything. Use GraphQL as your source of truth. GraphQL Editor Official CLI.", "author": "Artur Czemiel", "license": "MIT", "type": "module", "scripts": { - "cli": "node ../cli/lib/index.js", + "cli": "npx gecli schema pull", "integrate": "npm run cli -- gei integrate" }, - "devDependencies": {}, - "dependencies": {} + "dependencies": { + "graphql-editor-cli": "^0.9.4" + } } diff --git a/packages/sandbox/s.graphql b/packages/sandbox/s.graphql new file mode 100644 index 0000000..3c52c60 --- /dev/null +++ b/packages/sandbox/s.graphql @@ -0,0 +1,169 @@ +interface Nameable{ + name: String! +} + +enum SpecialSkills{ + """ + Lower enemy defense -5
+ """ + THUNDER + """ + Attack multiple Cards at once
+ """ + RAIN + """ + 50% chance to avoid any attack
+ """ + FIRE +} + +type Query{ + cardById( + cardId: String + ): Card + """ + Draw a card
+ """ + drawCard: Card! + drawChangeCard: ChangeCard! + """ + list All Cards availble
+ """ + listCards: [Card!]! + myStacks: [CardStack!] + nameables: [Nameable!]! + public: Public +} + +""" +create card inputs
+""" +input createCard{ + """ + The name of a card
+ """ + name: String! + """ + Description of a card
+ """ + description: String! + """ +
How many children the greek god had
+ """ + Children: Int + """ + The attack power
+ """ + Attack: Int! + """ + The defense power
+ """ + Defense: Int! + """ + input skills + """ + skills: [SpecialSkills!] +} + +""" +Stack of cards +""" +type CardStack implements Nameable{ + cards: [Card!] + name: String! +} + +""" +Card used in card game
+""" +type Card implements Nameable{ + """ + The attack power
+ """ + Attack: Int! + """ +
How many children the greek god had
+ """ + Children: Int + """ + The defense power
+ """ + Defense: Int! + """ + Attack other cards on the table , returns Cards after attack
+ """ + attack( + """ + Attacked card/card ids
+ """ + cardID: [String!]! + ): [Card!] + """ + Put your description here + """ + cardImage: S3Object + """ + Description of a card
+ """ + description: String! + id: ID! + image: String! + info: JSON! + """ + The name of a card
+ """ + name: String! + skills: [SpecialSkills!] +} + +type SpecialCard implements Nameable{ + effect: String! + name: String! +} + +type EffectCard implements Nameable{ + effectSize: Float! + name: String! +} + +type Mutation{ + """ + add Card to Cards database
+ """ + addCard( + card: createCard! + ): Card! +} + +scalar JSON + +""" +Aws S3 File +""" +type S3Object{ + bucket: String! + key: String! + region: String! +} + +type Public{ + powerups( + filter: String! + ): [Powerup!] +} + +type Powerup{ + name: String +} + +union ChangeCard = SpecialCard | EffectCard + +type Subscription{ + deck: [Card!] +} + +schema{ + query: Query + mutation: Mutation + subscription: Subscription +}