Skip to content

Commit

Permalink
finished hostListing page flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jalajcodes committed Sep 15, 2020
1 parent 5f4de25 commit 540ce2e
Show file tree
Hide file tree
Showing 8 changed files with 312 additions and 46 deletions.
140 changes: 140 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,115 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "HostListingInput",
"description": null,
"fields": null,
"inputFields": [
{
"name": "title",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "description",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "image",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "type",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "ListingType",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "address",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "price",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "numOfGuests",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"defaultValue": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Query",
Expand Down Expand Up @@ -1156,6 +1265,37 @@
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "hostListing",
"description": null,
"args": [
{
"name": "input",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "INPUT_OBJECT",
"name": "HostListingInput",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Listing",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
Expand Down
6 changes: 5 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ const App = () => {
<Layout id="app">
{loginErrorBanner}
<Affix offsetTop={0} className="app__affix-header">
<AppHeader />
<div>


<AppHeader />
</div>
</Affix>
<Switch>
<Route exact path="/">
Expand Down
10 changes: 10 additions & 0 deletions src/lib/graphql/globalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ export enum ListingsFilter {
PRICE_LOW_TO_HIGH = "PRICE_LOW_TO_HIGH",
}

export interface HostListingInput {
title: string;
description: string;
image: string;
type: ListingType;
address: string;
price: number;
numOfGuests: number;
}

export interface LogInInput {
code: string;
}
Expand Down
23 changes: 23 additions & 0 deletions src/lib/graphql/mutations/HostListing/__generated__/HostListing.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/lib/graphql/mutations/HostListing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { gql } from '@apollo/client';

export const HOST_LISTING = gql`
mutation HostListing($input: HostListingInput!) {
hostListing(input: $input) {
id
}
}
`;
1 change: 1 addition & 0 deletions src/lib/graphql/mutations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './LogIn';
export * from './LogOut';
export * from './ConnectStripe';
export * from './DisconnectStripe';
export * from './HostListing';
Loading

0 comments on commit 540ce2e

Please sign in to comment.