@tinacms/graphql 0.60.4 → 0.60.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +11 -11
- package/dist/resolver/index.d.ts +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -12480,7 +12480,7 @@ var validateField = async (field) => {
|
|
|
12480
12480
|
|
|
12481
12481
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/graphql/package.json
|
|
12482
12482
|
var name = "@tinacms/graphql";
|
|
12483
|
-
var version = "0.60.
|
|
12483
|
+
var version = "0.60.5";
|
|
12484
12484
|
var main = "dist/index.js";
|
|
12485
12485
|
var typings = "dist/index.d.ts";
|
|
12486
12486
|
var files = [
|
|
@@ -22751,10 +22751,6 @@ var Resolver = class {
|
|
|
22751
22751
|
})
|
|
22752
22752
|
};
|
|
22753
22753
|
};
|
|
22754
|
-
this.getDocumentsForCollection = async (collectionName) => {
|
|
22755
|
-
const collection = this.tinaSchema.getCollection(collectionName);
|
|
22756
|
-
return this.database.store.glob(collection.path, this.getDocument);
|
|
22757
|
-
};
|
|
22758
22754
|
this.referenceResolver = async (filter, fieldDefinition) => {
|
|
22759
22755
|
const referencedCollection = this.tinaSchema.getCollection(fieldDefinition.collections[0]);
|
|
22760
22756
|
if (!referencedCollection) {
|
|
@@ -22779,9 +22775,11 @@ var Resolver = class {
|
|
|
22779
22775
|
collection,
|
|
22780
22776
|
hydrator
|
|
22781
22777
|
}) => {
|
|
22778
|
+
var _a, _b, _c, _d;
|
|
22782
22779
|
let edges;
|
|
22783
22780
|
let pageInfo;
|
|
22784
|
-
|
|
22781
|
+
const useDataLayer = Boolean((_d = (_c = (_b = (_a = this.tinaSchema) == null ? void 0 : _a.config) == null ? void 0 : _b.meta) == null ? void 0 : _c.flags) == null ? void 0 : _d.find((x) => x === "experimentalData"));
|
|
22782
|
+
if (useDataLayer) {
|
|
22785
22783
|
let conditions;
|
|
22786
22784
|
if (args.filter) {
|
|
22787
22785
|
if (collection.fields) {
|
|
@@ -23005,12 +23003,14 @@ var resolve = async ({
|
|
|
23005
23003
|
database,
|
|
23006
23004
|
silenceErrors
|
|
23007
23005
|
}) => {
|
|
23006
|
+
var _a;
|
|
23008
23007
|
try {
|
|
23009
23008
|
const graphQLSchemaAst = await database.getGraphQLSchema();
|
|
23010
23009
|
const graphQLSchema = (0, import_graphql3.buildASTSchema)(graphQLSchemaAst);
|
|
23011
23010
|
const tinaConfig = await database.getTinaSchema();
|
|
23012
23011
|
const tinaSchema = await createSchema({
|
|
23013
|
-
schema: tinaConfig
|
|
23012
|
+
schema: tinaConfig,
|
|
23013
|
+
flags: (_a = tinaConfig == null ? void 0 : tinaConfig.meta) == null ? void 0 : _a.flags
|
|
23014
23014
|
});
|
|
23015
23015
|
const resolver2 = await createResolver2({ config, database, tinaSchema });
|
|
23016
23016
|
const res = await (0, import_graphql3.graphql)({
|
|
@@ -23044,8 +23044,8 @@ var resolve = async ({
|
|
|
23044
23044
|
if (info.fieldName === "collections") {
|
|
23045
23045
|
const collectionNode2 = info.fieldNodes.find((x) => x.name.value === "collections");
|
|
23046
23046
|
const hasDocuments2 = collectionNode2.selectionSet.selections.find((x) => {
|
|
23047
|
-
var
|
|
23048
|
-
return ((
|
|
23047
|
+
var _a2;
|
|
23048
|
+
return ((_a2 = x == null ? void 0 : x.name) == null ? void 0 : _a2.value) === "documents";
|
|
23049
23049
|
});
|
|
23050
23050
|
return tinaSchema.getCollections().map((collection) => {
|
|
23051
23051
|
return resolver2.resolveCollection(args, collection.name, Boolean(hasDocuments2));
|
|
@@ -23053,8 +23053,8 @@ var resolve = async ({
|
|
|
23053
23053
|
}
|
|
23054
23054
|
const collectionNode = info.fieldNodes.find((x) => x.name.value === "collection");
|
|
23055
23055
|
const hasDocuments = collectionNode.selectionSet.selections.find((x) => {
|
|
23056
|
-
var
|
|
23057
|
-
return ((
|
|
23056
|
+
var _a2;
|
|
23057
|
+
return ((_a2 = x == null ? void 0 : x.name) == null ? void 0 : _a2.value) === "documents";
|
|
23058
23058
|
});
|
|
23059
23059
|
return resolver2.resolveCollection(args, args.collection, Boolean(hasDocuments));
|
|
23060
23060
|
}
|
package/dist/resolver/index.d.ts
CHANGED
|
@@ -203,7 +203,6 @@ export declare class Resolver {
|
|
|
203
203
|
};
|
|
204
204
|
}[];
|
|
205
205
|
}>;
|
|
206
|
-
getDocumentsForCollection: (collectionName: string) => Promise<string[]>;
|
|
207
206
|
private referenceResolver;
|
|
208
207
|
private resolveFilterConditions;
|
|
209
208
|
resolveCollectionConnection: ({ args, collection, hydrator, }: {
|