@data-eden/athena
Advanced tools
Comparing version 0.17.1 to 0.17.2
@@ -0,14 +1,14 @@ | ||
import { createServer } from '@data-eden/shared-test-utilities'; | ||
import { readFileSync } from 'fs'; | ||
import http from 'http'; | ||
import { resolve } from 'path'; | ||
import { | ||
afterAll, | ||
afterEach, | ||
beforeAll, | ||
beforeEach, | ||
describe, | ||
expect, | ||
test, | ||
expect, | ||
beforeEach, | ||
beforeAll, | ||
afterAll, | ||
afterEach, | ||
} from 'vitest'; | ||
import http from 'http'; | ||
import { readFileSync } from 'fs'; | ||
import { resolve } from 'path'; | ||
import { createServer } from '@data-eden/shared-test-utilities'; | ||
@@ -20,6 +20,6 @@ import { createSignal } from '@signalis/core'; | ||
import { type PeopleQuery } from './__generated/client.test.graphql'; | ||
import { AthenaClient } from '../src/client.js'; | ||
import type { ReactiveSignal } from '../src/types.js'; | ||
import { prepareOperation } from '../src/utils'; | ||
import { type PeopleQuery } from './__generated/client.test.graphql'; | ||
@@ -211,2 +211,71 @@ const schema = readFileSync( | ||
test('multiple occurrences of the same entity should deep merge their properties', async () => { | ||
const document = { | ||
foo: { | ||
id: '1', | ||
__typename: 'Foo', | ||
comments: [ | ||
{ | ||
id: '1', | ||
__typename: 'Comment', | ||
message: 'first comment', | ||
author: { | ||
id: '1', | ||
__typename: 'Author', | ||
name: 'Foo', | ||
}, | ||
}, | ||
{ | ||
id: '2', | ||
__typename: 'Comment', | ||
message: 'first comment', | ||
author: { | ||
id: '1', | ||
__typename: 'Author', | ||
name: 'Foo', | ||
// This property does not exist on the prior instance of Author:1, but should | ||
// exist on both versions that get written out | ||
age: 10, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; | ||
const result = await client.processEntities(document); | ||
expect(result).toMatchInlineSnapshot(` | ||
{ | ||
"foo": { | ||
"__typename": "Foo", | ||
"comments": [ | ||
{ | ||
"__typename": "Comment", | ||
"author": { | ||
"__typename": "Author", | ||
"age": 10, | ||
"id": "1", | ||
"name": "Foo", | ||
}, | ||
"id": "1", | ||
"message": "first comment", | ||
}, | ||
{ | ||
"__typename": "Comment", | ||
"author": { | ||
"__typename": "Author", | ||
"age": 10, | ||
"id": "1", | ||
"name": "Foo", | ||
}, | ||
"id": "2", | ||
"message": "first comment", | ||
}, | ||
], | ||
"id": "1", | ||
}, | ||
} | ||
`); | ||
}); | ||
test('parses a document with an array of entities at the root', async () => { | ||
@@ -213,0 +282,0 @@ const document = { |
{ | ||
"name": "@data-eden/athena", | ||
"version": "0.17.1", | ||
"version": "0.17.2", | ||
"repository": { | ||
@@ -27,3 +27,3 @@ "type": "git", | ||
"dependencies": { | ||
"@data-eden/cache": "^0.17.1", | ||
"@data-eden/cache": "^0.17.2", | ||
"date-fns": "^2.30.0", | ||
@@ -33,5 +33,5 @@ "lodash-es": "^4.17.21" | ||
"devDependencies": { | ||
"@data-eden/codegen": "0.17.1", | ||
"@data-eden/mocker": "0.17.1", | ||
"@data-eden/shared-test-utilities": "0.17.1", | ||
"@data-eden/codegen": "0.17.2", | ||
"@data-eden/mocker": "0.17.2", | ||
"@data-eden/shared-test-utilities": "0.17.2", | ||
"@graphql-typed-document-node/core": "^3.2.0", | ||
@@ -38,0 +38,0 @@ "@signalis/core": "^0.1.0", |
@@ -32,2 +32,3 @@ import { defineConfig } from 'vitest/config'; | ||
'@data-eden/athena': resolve(__dirname, './src'), | ||
'@data-eden/cache': resolve(__dirname, '../cache/src'), | ||
'@data-eden/mocker': resolve(__dirname, '../mocker/src'), | ||
@@ -34,0 +35,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1071743
6695
Updated@data-eden/cache@^0.17.2