本文整理汇总了TypeScript中graphql-anywhere.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: diffQueryAgainstStore
export function diffQueryAgainstStore({
store,
query,
variables,
returnPartialData = true,
config,
}: ReadQueryOptions): DiffResult {
// Throw the right validation error by trying to find a query in the document
getQueryDefinition(query);
const context: ReadStoreContext = {
// Global settings
store,
returnPartialData,
customResolvers: config && config.customResolvers,
// Flag set during execution
hasMissingField: false,
};
const rootIdValue = {
type: 'id',
id: 'ROOT_QUERY',
};
const result = graphqlAnywhere(readStoreResolver, query, rootIdValue, context, variables, {
fragmentMatcher,
});
return {
result,
isMissing: context.hasMissingField,
};
}
示例2: diffQueryAgainstStore
export function diffQueryAgainstStore({
store,
query,
variables,
previousResult,
returnPartialData = true,
rootId = 'ROOT_QUERY',
fragmentMatcherFunction,
config,
}: DiffQueryAgainstStoreOptions): DiffResult {
// Throw the right validation error by trying to find a query in the document
const queryDefinition = getQueryDefinition(query);
variables = assign({}, getDefaultValues(queryDefinition), variables);
const context: ReadStoreContext = {
// Global settings
store,
returnPartialData,
customResolvers: (config && config.customResolvers) || {},
// Flag set during execution
hasMissingField: false,
};
const rootIdValue = {
type: 'id',
id: rootId,
previousResult,
};
const result = graphqlAnywhere(
readStoreResolver,
query,
rootIdValue,
context,
variables,
{
fragmentMatcher: fragmentMatcherFunction,
resultMapper,
},
);
return {
result,
isMissing: context.hasMissingField,
};
}