Skip to content

Commit

Permalink
TECH-1128: Allow to pass worskpace to getNodeByPath (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
jahia-carp authored Apr 21, 2023
1 parent 327c967 commit 72fabb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions fixtures/graphql/jcr/query/getNodeByPath.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query getNodeByPath($path: String!, $properties: [String]=[], $language: String="", $childrenTypes: [String] = []) {
jcr {
query getNodeByPath($path: String!, $properties: [String]=[], $language: String="", $childrenTypes: [String] = [], $workspace: Workspace = EDIT ) {
jcr (workspace: $workspace){
nodeByPath(path: $path) {
uuid
name
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jahia/cypress",
"version": "3.9.0",
"version": "3.10.0",
"scripts": {
"build": "tsc",
"lint": "eslint src -c .eslintrc.json --ext .ts"
Expand Down
5 changes: 3 additions & 2 deletions src/utils/JCRHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ export const addNode = (variables: { parentPathOrId: string, primaryNodeType: st
});
};

export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = []): Cypress.Chainable => {
export const getNodeByPath = (path: string, properties?: string[], language?: string, childrenTypes: string[] = [], workspace: 'EDIT' | 'LIVE' = 'EDIT'): Cypress.Chainable => {
return cy.apollo({
variables: {
path: path,
properties: properties,
language: language,
childrenTypes: childrenTypes
childrenTypes: childrenTypes,
workspace: workspace
},
queryFile: 'graphql/jcr/query/getNodeByPath.graphql'
});
Expand Down

0 comments on commit 72fabb6

Please sign in to comment.