This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// store/index.js | |
actions: { | |
nuxtServerInit ({ dispatch }, context) { | |
return Promise.all([ | |
dispatch('user/nuxtServerInit', context), | |
dispatch('news/nuxtServerInit', context) | |
]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// store/index.js | |
actions: { | |
nuxtServerInit ({ commit}, { req }) { | |
if (req.session.user) { | |
commit('setUser', req.session.user); | |
return axios.get(`/users/${req.session.user}`).then((response) =>{ | |
commit('currentUserData', response.data); | |
}) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(schemaCode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const fs = require('fs') | |
const path = require('path') | |
const { expect } = require('chai') | |
const EasyGraphQLTester = require('../lib') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8') | |
describe('Mutation', () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(schemaCode) | |
const mutation = ` | |
mutation CreateUser{ | |
createUser { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(schemaCode) | |
const getUserByUsername = ` | |
{ | |
getUserByUsername(username: 1, name: test) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(schemaCode) | |
const query = ` | |
{ | |
getMe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const userSchema = fs.readFileSync(path.join(__dirname, 'schema', 'user.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(userSchema) | |
const query = ` | |
{ | |
getUser(id: "1") { | |
id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(schemaCode) | |
const mutation = ` | |
mutation CreateUser{ | |
createUser { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EasyGraphQLTester = require('easygraphql-tester') | |
const fs = require('fs') | |
const path = require('path') | |
const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8') | |
const tester = new EasyGraphQLTester(schemaCode) | |
const query = ` | |
{ | |
getMe { |