Skip to content

Instantly share code, notes, and snippets.

View BartoszBilejczyk's full-sized avatar

Bartosz Bilejczyk BartoszBilejczyk

View GitHub Profile
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
const routes = [
{
path: '/dashboard',
name: 'Dashboard',
component: () =>
// Create the apollo client
export const apolloClient = new ApolloClient({
link: authLink.concat(httpLink),
cache,
typeDefs,
resolvers: {}
})
import gql from 'graphql-tag';
export const GET_RESULTS = gql`
query GetResults($term: String, $category: String) {
search (
term: $term,
categories: $category,
limit: 50
latitude: 52.237022,
longitude: 21.050440,
const apolloProvider = new VueApollo({
defaultClient: apolloClient,
defaultOptions: {
// apollo options applied to all queries in components
$query: {
loadingKey: 'loading',
fetchPolicy: 'cache-and-network'
}
}
})
<template>
<div id="app">
<ApolloQuery
:query="GET_RESULTS"
:notifyOnNetworkStatusChange="true"
>
<template v-slot="{ result: { data, loading }, query }">
<AppNav @search="handleSearch($event, query)" />
<div class="content">
<div class="container">
import gql from 'graphql-tag';
export const GET_ZOOM = gql`
{
zoom @client
}
`
export const GET_CENTER = gql`
{
center @client {
// part of dashboard.interfaces.ts
export interface Notification {
id: number,
type: string,
message: string,
date: string
}
export interface NotificationsReturnData {
<template>
<div class="dashboard">
<Suspense>
<div class="dashboard__content">
<AppHeader
class="dashboard__header"
@submit-appointment="appointments.handleSubmitAppointment"
></AppHeader>
<Teleport to="#news-modal">
<div
<template>
<div class="dashboard">
<AppHeader
:user="user"
class="app__header"
@submit-appointment="handleSubmitAppointment"
></AppHeader>
<div
v-if="newsModalOpen"
class="modal"
<template>
<header class="app-header">
<Teleport
to="#appointment-modal"
:disabled="state.preview"
>
<div
v-if="state.modalOpen && !state.preview"
class="modal"
>