@bizniche/react
Advanced tools
Comparing version 0.3.3 to 0.3.4
import { QueryHookOptions } from '@apollo/client'; | ||
import { BiznicheBlogPost } from '../types'; | ||
interface GetFeedQueryOptions { | ||
limit: number; | ||
offset: number; | ||
input: { | ||
limit: number; | ||
offset: number; | ||
}; | ||
} | ||
export declare function useGetFeedQuery(queryOptions?: GetFeedQueryOptions & QueryHookOptions): { | ||
export declare function useGetFeedQuery(queryOptions?: QueryHookOptions<GetFeedQueryOptions>): { | ||
feed: BiznicheBlogPost[]; | ||
loading: boolean; | ||
error: import("@apollo/client").ApolloError | undefined; | ||
refetch: (variables?: Partial<import("@apollo/client").OperationVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<any>>; | ||
}; | ||
export {}; |
@@ -0,14 +1,13 @@ | ||
import { QueryHookOptions } from '@apollo/client'; | ||
import { BiznicheBlogPost } from '../types'; | ||
interface GetPostQueryOptions { | ||
input: { | ||
id?: string; | ||
slug?: string; | ||
slug: string; | ||
}; | ||
} | ||
export declare function useGetPostQuery(queryOptions: GetPostQueryOptions): { | ||
export declare function useGetPostQuery(queryOptions: QueryHookOptions<GetPostQueryOptions>): { | ||
post: BiznicheBlogPost; | ||
loading: boolean; | ||
error: import("@apollo/client").ApolloError | undefined; | ||
refetch: (variables?: Partial<import("@apollo/client").OperationVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<any>>; | ||
}; | ||
export {}; |
import { jsx as c } from "react/jsx-runtime"; | ||
import { HttpLink as s, ApolloClient as a, InMemoryCache as d, ApolloProvider as l, gql as i, useQuery as o } from "@apollo/client"; | ||
const p = "https://api.bizniche.co/graphql"; | ||
import { HttpLink as s, ApolloClient as p, InMemoryCache as d, ApolloProvider as a, gql as i, useQuery as u } from "@apollo/client"; | ||
const l = "https://api.bizniche.co/graphql"; | ||
function y({ | ||
@@ -8,3 +8,3 @@ apiKey: t | ||
const e = new s({ | ||
uri: p, | ||
uri: l, | ||
headers: { | ||
@@ -14,3 +14,3 @@ "x-bizniche-api-key": t | ||
}); | ||
return new a({ | ||
return new p({ | ||
link: e, | ||
@@ -23,10 +23,10 @@ cache: new d({}) | ||
children: e | ||
}) => /* @__PURE__ */ c(l, { client: y({ apiKey: t }), children: e }), Q = i` | ||
query GetFeedQuery { | ||
getFeedQuery { | ||
}) => /* @__PURE__ */ c(a, { client: y({ apiKey: t }), children: e }), Q = i` | ||
query GetFeedQuery($input: GetFeedQueryInput) { | ||
getFeedQuery(input: $input) { | ||
id | ||
title | ||
slug | ||
description | ||
content | ||
description | ||
author { | ||
@@ -43,7 +43,11 @@ id | ||
function P(t) { | ||
const { data: e, loading: r, error: n } = o(Q, t); | ||
const { data: e, loading: r, error: n, refetch: o } = u( | ||
Q, | ||
t | ||
); | ||
return { | ||
feed: e == null ? void 0 : e.getFeedQuery, | ||
loading: r, | ||
error: n | ||
error: n, | ||
refetch: o | ||
}; | ||
@@ -70,12 +74,7 @@ } | ||
function f(t) { | ||
const { data: e, loading: r, error: n, refetch: u } = o(g, { | ||
variables: { | ||
...t | ||
} | ||
}); | ||
const { data: e, loading: r, error: n } = u(g, t); | ||
return { | ||
post: e == null ? void 0 : e.getPostQuery, | ||
loading: r, | ||
error: n, | ||
refetch: u | ||
error: n | ||
}; | ||
@@ -82,0 +81,0 @@ } |
{ | ||
"name": "@bizniche/react", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"author": "Matt Gordon <matt@lemonade.tech>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
4891
141