Skip to content

Commit

Permalink
start files
Browse files Browse the repository at this point in the history
  • Loading branch information
linklib committed Jan 15, 2021
1 parent f392aa6 commit e2787bf
Show file tree
Hide file tree
Showing 24 changed files with 89,750 additions and 254,338 deletions.
10 changes: 10 additions & 0 deletions pages/beers/[id].tsx
@@ -0,0 +1,10 @@
import { useRouter } from 'next/dist/client/router'
import { Page } from 'src/pages/_App/interfaces'

const BeerPage: Page = () => {
const router = useRouter()

return <>{router.query.id}</>
}

export default BeerPage
1 change: 1 addition & 0 deletions pages/beers/index.ts
@@ -0,0 +1 @@
export { default } from 'src/pages/Beers'
10 changes: 10 additions & 0 deletions pages/contacts.tsx
@@ -0,0 +1,10 @@
import { NextSeo } from 'next-seo'

export default () => {
return (
<>
<NextSeo title="Contacts" description="My contacts" noindex />
Contacts
</>
)
}
2 changes: 1 addition & 1 deletion src/config/index.ts
Expand Up @@ -3,4 +3,4 @@ import DotEnv from 'dotenv'
DotEnv.config()

// API Endpoint
export const endpoint = process.env.API_ENDPOINT || 'https://api.prisma-cms.com'
export const endpoint = process.env.API_ENDPOINT || 'https://pivkarta.ru/api/'
31 changes: 31 additions & 0 deletions src/gql/Beer.graphql
@@ -0,0 +1,31 @@
query beers($where: BeerWhereInput, $first: Int = 3, $skip: Int) {
beersConnection(where: $where, first: $first, skip: $skip) {
aggregate {
count
}
edges {
node {
...beer
}
}
}
}

fragment beer on Beer {
id
name
uri
places {
id
price
Place {
...place
}
}
}

fragment place on Place {
id
name
uri
}
32 changes: 32 additions & 0 deletions src/modules/gql/generated/beer.ts
@@ -0,0 +1,32 @@
/* eslint-disable */

/**
* ФАЙЛ ГЕНЕРИРУЕТСЯ АВТОМАТИЧЕСКИ, ПРАВИТЬ ЕГО НЕ НУЖНО
* Команда для генерирования этого файла: "yarn generate:types"
*/


import * as Types from './types';

import { PlaceFragment } from './place';
import { gql } from '@apollo/client';
import { PlaceFragmentDoc } from './place';
export type BeerFragment = { __typename?: 'Beer', id: string, name?: Types.Maybe<string>, uri?: Types.Maybe<string>, places?: Types.Maybe<Array<{ __typename?: 'PlaceBeer', id: string, price?: Types.Maybe<number>, Place: (
{ __typename?: 'Place' }
& PlaceFragment
) }>> };

export const BeerFragmentDoc = gql`
fragment beer on Beer {
id
name
uri
places {
id
price
Place {
...place
}
}
}
${PlaceFragmentDoc}`;
69 changes: 69 additions & 0 deletions src/modules/gql/generated/beers.ts
@@ -0,0 +1,69 @@
/* eslint-disable */

/**
* ФАЙЛ ГЕНЕРИРУЕТСЯ АВТОМАТИЧЕСКИ, ПРАВИТЬ ЕГО НЕ НУЖНО
* Команда для генерирования этого файла: "yarn generate:types"
*/


import * as Types from './types';

import { BeerFragment } from './beer';
import { gql } from '@apollo/client';
import { BeerFragmentDoc } from './beer';
import * as Apollo from '@apollo/client';
export type BeersQueryVariables = Types.Exact<{
where?: Types.Maybe<Types.BeerWhereInput>;
first?: Types.Maybe<Types.Scalars['Int']>;
skip?: Types.Maybe<Types.Scalars['Int']>;
}>;


export type BeersQuery = { __typename?: 'Query', beersConnection: { __typename?: 'BeerConnection', aggregate: { __typename?: 'AggregateBeer', count: number }, edges: Array<Types.Maybe<{ __typename?: 'BeerEdge', node: (
{ __typename?: 'Beer' }
& BeerFragment
) }>> } };


export const BeersDocument = gql`
query beers($where: BeerWhereInput, $first: Int = 3, $skip: Int) {
beersConnection(where: $where, first: $first, skip: $skip) {
aggregate {
count
}
edges {
node {
...beer
}
}
}
}
${BeerFragmentDoc}`;

/**
* __useBeersQuery__
*
* To run a query within a React component, call `useBeersQuery` and pass it any options that fit your needs.
* When your component renders, `useBeersQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useBeersQuery({
* variables: {
* where: // value for 'where'
* first: // value for 'first'
* skip: // value for 'skip'
* },
* });
*/
export function useBeersQuery(baseOptions?: Apollo.QueryHookOptions<BeersQuery, BeersQueryVariables>) {
return Apollo.useQuery<BeersQuery, BeersQueryVariables>(BeersDocument, baseOptions);
}
export function useBeersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<BeersQuery, BeersQueryVariables>) {
return Apollo.useLazyQuery<BeersQuery, BeersQueryVariables>(BeersDocument, baseOptions);
}
export type BeersQueryHookResult = ReturnType<typeof useBeersQuery>;
export type BeersLazyQueryHookResult = ReturnType<typeof useBeersLazyQuery>;
export type BeersQueryResult = Apollo.QueryResult<BeersQuery, BeersQueryVariables>;

0 comments on commit e2787bf

Please sign in to comment.