I have no idea if this is right

This commit is contained in:
DMehaffy 2019-04-05 07:45:56 -07:00
parent 88e1ce2c57
commit f92f76dd59

View File

@ -18,6 +18,12 @@ const postModel = {
type: 'string', type: 'string',
}, },
}, },
{
name: 'bigint',
params: {
type: 'biginteger'
},
},
], ],
connection: 'default', connection: 'default',
name: 'post', name: 'post',
@ -69,7 +75,7 @@ describe('Test Graphql API End to End', () => {
}); });
describe('Test CRUD', () => { describe('Test CRUD', () => {
const postsPayload = [{ name: 'post 1' }, { name: 'post 2' }]; const postsPayload = [{ name: 'post 1', bigint: 1316130638171 }, { name: 'post 2', bigint: 1416130639261 }];
let data = { let data = {
posts: [], posts: [],
}; };
@ -81,6 +87,7 @@ describe('Test Graphql API End to End', () => {
createPost(input: $input) { createPost(input: $input) {
post { post {
name name
bigint
} }
} }
} }
@ -111,6 +118,7 @@ describe('Test Graphql API End to End', () => {
posts { posts {
id id
name name
bigint
} }
} }
`, `,
@ -136,6 +144,7 @@ describe('Test Graphql API End to End', () => {
posts(limit: 1) { posts(limit: 1) {
id id
name name
bigint
} }
} }
`, `,
@ -156,6 +165,7 @@ describe('Test Graphql API End to End', () => {
posts(sort: "name:desc") { posts(sort: "name:desc") {
id id
name name
bigint
} }
} }
`, `,
@ -176,6 +186,7 @@ describe('Test Graphql API End to End', () => {
posts(start: 1) { posts(start: 1) {
id id
name name
bigint
} }
} }
`, `,
@ -193,18 +204,21 @@ describe('Test Graphql API End to End', () => {
[ [
{ {
name: 'post 1', name: 'post 1',
bigint: 1316130638171,
}, },
[postsPayload[0]], [postsPayload[0]],
], ],
[ [
{ {
name_eq: 'post 1', name_eq: 'post 1',
bigint_eq: 1316130638171,
}, },
[postsPayload[0]], [postsPayload[0]],
], ],
[ [
{ {
name_ne: 'post 1', name_ne: 'post 1',
bigint_ne: 1316130638171,
}, },
[postsPayload[1]], [postsPayload[1]],
], ],
@ -235,12 +249,14 @@ describe('Test Graphql API End to End', () => {
[ [
{ {
name_in: ['post 1', 'post 2'], name_in: ['post 1', 'post 2'],
bigint_in: [1316130638171, 1416130639261],
}, },
postsPayload, postsPayload,
], ],
[ [
{ {
name_nin: ['post 2'], name_nin: ['post 2'],
bigint_nin: [1416130639261],
}, },
[postsPayload[0]], [postsPayload[0]],
], ],
@ -250,6 +266,7 @@ describe('Test Graphql API End to End', () => {
query findPosts($where: JSON) { query findPosts($where: JSON) {
posts(where: $where) { posts(where: $where) {
name name
bigint
} }
} }
`, `,
@ -273,6 +290,7 @@ describe('Test Graphql API End to End', () => {
post(id: $id) { post(id: $id) {
id id
name name
bigint
} }
} }
`, `,
@ -298,6 +316,7 @@ describe('Test Graphql API End to End', () => {
post { post {
id id
name name
bigint
} }
} }
} }
@ -337,6 +356,7 @@ describe('Test Graphql API End to End', () => {
deletePost(input: $input) { deletePost(input: $input) {
post { post {
name name
bigint
} }
} }
} }