async start() { const modelGraph = ( await tf.node.getMetaGraphsFromSavedModel(this.settings.path) )[0]; this.params = Runtime.computeParams(this.settings, modelGraph); await this.worker.loadModel(this.params); }
test('filter number by between', async () => { const { errors, data } = await createSchemaAndExecute(`{ allProduct (filter: { price: { between: [120, 150] } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(1) expect(data.allProduct.edges[0].node.id).toEqual('3') })
function sh_setHref(tags, numTags, inputString) { var url = inputString.substring(tags[numTags - 2].pos, tags[numTags - 1].pos); if (url.length >= 2 && url.charAt(0) === '<' && url.charAt(url.length - 1) === '>') { url = url.substr(1, url.length - 2); } if (sh_isEmailAddress(url)) { url = 'mailto:' + url; } tags[numTags - 2].node.href = url; }
function reportError(context, node, message, fixDetails) { context.report({ node, message, fix: fixDetails && (fixer => { return fixer.replaceText( node, `${context.getSourceCode().getText(fixDetails.node)} ${fixDetails.operator} ${fixDetails.value}` ); }) }); }
function runMain(filename, env) { return node([ "-r", "../index.js", filename ], env) }
expect( (await findObjects('GraphQLClass')).data.find.edges.map( object => object.node.someField ) ).toEqual([]);
expect( ( await findObjects('GraphQLClass', { 'X-Parse-Session-Token': user1.getSessionToken(), }) ).data.find.edges .map(object => object.node.someField) .sort() ).toEqual(['someValue1', 'someValue2', 'someValue3']);
test('filter by multiple ids', async () => { const { errors, data } = await createSchemaAndExecute(`{ allProduct (filter: { id: { in: ["2", "3"] } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(2) expect(data.allProduct.edges[0].node.id).toEqual('3') expect(data.allProduct.edges[1].node.id).toEqual('2') })
test('eq', async () => { const { errors, data } = await runQuery(`{ allProduct (filter: { relatedId: { id: { eq: "2" } } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(1) expect(data.allProduct.edges[0].node.id).toEqual('3') })
test('eq (inferred)', async () => { const { errors, data } = await runQuery(`{ allProduct (filter: { related: { id: { eq: "2" } } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(1) expect(data.allProduct.edges[0].node.id).toEqual('3') })
test('filter number by gt', async () => { const { errors, data } = await createSchemaAndExecute(`{ allProduct (filter: { price: { gt: 120 } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(2) expect(data.allProduct.edges[0].node.id).toEqual('3') expect(data.allProduct.edges[1].node.id).toEqual('2') })
test('eq', async () => { const { errors, data } = await runQuery(`{ allProduct (filter: { relatedId: { id: { eq: "2" } } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(1) expect(data.allProduct.edges[0].node.id).toEqual('3') })
test('eq', async () => { const { errors, data } = await runQuery(`{ allProduct (filter: { alternativeIds: { id: { eq: "1" } } }) { edges { node { id } } } }`) expect(errors).toBeUndefined() expect(data.allProduct.edges).toHaveLength(1) expect(data.allProduct.edges[0].node.id).toEqual('2') })
expect( (await findObjects('PublicClass')).data.find.edges.map( object => object.node.someField ) ).toEqual(['someValue4']);
expect( ( await findObjects('PublicClass', { 'X-Parse-Master-Key': 'test', }) ).data.find.edges.map(object => object.node.someField) ).toEqual(['someValue4']);