From 8aa012cb24b5aefbda7444fafb9560b33deeed43 Mon Sep 17 00:00:00 2001
From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>
Date: Wed, 10 Mar 2021 00:30:43 -0500
Subject: [PATCH 1/2] Add GraphQL
- Remove Fetch requests
- Add graphql support
- react go brrr
---
client/package.json | 2 +
client/src/components/App.js | 26 +-
client/src/components/MapTiles.jsx | 31 ++-
client/src/components/gyms/Gym.jsx | 43 ++-
client/src/components/pokemon/Pokemon.jsx | 40 +--
client/src/components/pokestops/Pokestop.jsx | 41 +--
client/src/services/Fetch.js | 17 +-
client/src/services/data/gyms.js | 16 --
client/src/services/data/pokemon.js | 16 --
client/src/services/data/pokestops.js | 16 --
client/src/services/queries.js | 27 ++
client/webpack.config.js | 1 +
server/package.json | 4 +
server/src/index.js | 18 +-
server/src/routes/api/v1/dataRouter.js | 39 ---
server/src/schema/gym.js | 34 +++
server/src/schema/pokemon.js | 44 +++
server/src/schema/pokestop.js | 39 +++
server/src/schema/schema.js | 74 +++++
yarn.lock | 271 +++++++++++++++++--
20 files changed, 582 insertions(+), 217 deletions(-)
delete mode 100644 client/src/services/data/gyms.js
delete mode 100644 client/src/services/data/pokemon.js
delete mode 100644 client/src/services/data/pokestops.js
create mode 100644 client/src/services/queries.js
create mode 100644 server/src/schema/gym.js
create mode 100644 server/src/schema/pokemon.js
create mode 100644 server/src/schema/pokestop.js
create mode 100644 server/src/schema/schema.js
diff --git a/client/package.json b/client/package.json
index 41d76aa4d..b1462e8be 100644
--- a/client/package.json
+++ b/client/package.json
@@ -20,6 +20,7 @@
"webpack-dev-server": "^3.11.2"
},
"dependencies": {
+ "@apollo/client": "^3.3.11",
"@babel/core": "^7.13.8",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-transform-react-jsx": "^7.12.17",
@@ -44,6 +45,7 @@
"react-hot-loader": "^4.13.0",
"react-leaflet": "^3.1.0",
"react-leaflet-markercluster": "^3.0.0-rc1",
+ "react-router-dom": "^5.2.0",
"sass-loader": "^11.0.1",
"source-map-loader": "^2.0.1",
"style-loader": "^2.0.0",
diff --git a/client/src/components/App.js b/client/src/components/App.js
index b8baca477..7b234acf5 100644
--- a/client/src/components/App.js
+++ b/client/src/components/App.js
@@ -1,10 +1,19 @@
import React, { useState, useEffect } from 'react'
+import { BrowserRouter as Router, Switch, Route } from "react-router-dom"
import { hot } from "react-hot-loader/root.js"
import "../assets/scss/main.scss"
import { MapContainer } from 'react-leaflet'
import MapTiles from './MapTiles.jsx'
import Fetch from '../services/Fetch.js'
+import Navbar from './layout/Navbar.jsx'
+
+import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client'
+
+const client = new ApolloClient({
+ uri: '/graphql',
+ cache: new InMemoryCache()
+})
const App = props => {
const [map, setMap] = useState(null)
@@ -20,11 +29,18 @@ const App = props => {
}, [])
return (
- <>
- {settings &&
- {map ? : null}
- }
- >
+
+
+
+
+
+ {settings &&
+ {map ? : null}
+ }
+
+
+
+
)
}
diff --git a/client/src/components/MapTiles.jsx b/client/src/components/MapTiles.jsx
index aa4aaf002..4ac9f0324 100644
--- a/client/src/components/MapTiles.jsx
+++ b/client/src/components/MapTiles.jsx
@@ -3,10 +3,29 @@ import { TileLayer } from 'react-leaflet'
import Gym from './gyms/Gym.jsx'
import Pokestop from './pokestops/Pokestop.jsx'
import Pokemon from './pokemon/Pokemon.jsx'
+import { useQuery } from '@apollo/client'
+import { getDataQuery } from '../services/queries.js'
const MapTiles = ({ map, settings }) => {
- const [bounds, setBounds] = useState(null)
+ const [bounds, setBounds] = useState({
+ _southWest: {
+ lat: 0,
+ lng: 0
+ },
+ _northEast: {
+ lat: 0,
+ lng: 0
+ }
+ })
const [position, setPosition] = useState({})
+ const { loading, error, data } = useQuery(getDataQuery, {
+ variables: {
+ minLat: bounds._southWest.lat,
+ minLon: bounds._southWest.lng,
+ maxLat: bounds._northEast.lat,
+ maxLon: bounds._northEast.lng
+ }
+ });
const onMove = useCallback(() => {
setPosition(map.getCenter())
@@ -29,9 +48,13 @@ const MapTiles = ({ map, settings }) => {
attribution={`© Stadia Maps, © OpenMapTiles © OpenStreetMap contributors`}
url="https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png"
/>
-
-
-
+ {data &&
+ <>
+
+
+
+ >
+ }
>
)
}
diff --git a/client/src/components/gyms/Gym.jsx b/client/src/components/gyms/Gym.jsx
index fc191b1ae..50783ecfa 100644
--- a/client/src/components/gyms/Gym.jsx
+++ b/client/src/components/gyms/Gym.jsx
@@ -1,37 +1,26 @@
import React, { useState, useEffect } from 'react'
import { Marker, Popup } from 'react-leaflet'
-import Fetch from '../../services/Fetch.js'
import MarkerIcon from './MarkerIcon.js'
import PopupContent from './Popup.jsx'
import MarkerClusterGroup from 'react-leaflet-markercluster'
-const Gym = ({ bounds }) => {
- const [gyms, setGyms] = useState([])
-
- const getGyms = async (bounds) => {
- if (bounds) setGyms(await Fetch.fetchGyms(bounds))
- }
-
- useEffect(() => {
- getGyms(bounds)
- }, [bounds])
-
- const allGyms = gyms.map(gym => {
- return (
-
-
-
-
-
- )
- })
-
+const Gym = ({ data }) => {
return (
-
- {allGyms}
+
+ {data.map(gym => {
+ return (
+
+
+
+
+
+ )
+ })}
)
}
diff --git a/client/src/components/pokemon/Pokemon.jsx b/client/src/components/pokemon/Pokemon.jsx
index bd6824cf7..33ce4edc9 100644
--- a/client/src/components/pokemon/Pokemon.jsx
+++ b/client/src/components/pokemon/Pokemon.jsx
@@ -5,35 +5,23 @@ import MarkerIcon from './MarkerIcon.js'
import PopupContent from './Popup.jsx'
import MarkerClusterGroup from 'react-leaflet-markercluster'
-const Pokemon = ({ bounds }) => {
- const [pokemon, setPokemon] = useState([])
-
- const getPokemon = async (bounds) => {
- if (bounds) setPokemon(await Fetch.fetchPokemon(bounds))
- }
-
- useEffect(() => {
- getPokemon(bounds)
- }, [bounds])
-
- const allPokemon = pokemon.map(pokemon => {
- return (
-
-
-
-
-
- )
- })
-
+const Pokemon = ({ data }) => {
return (
- {allPokemon}
+ {data.map(pokemon => {
+ return (
+
+
+
+
+
+ )
+ })}
)
}
diff --git a/client/src/components/pokestops/Pokestop.jsx b/client/src/components/pokestops/Pokestop.jsx
index 33ebe0708..2dc7af34c 100644
--- a/client/src/components/pokestops/Pokestop.jsx
+++ b/client/src/components/pokestops/Pokestop.jsx
@@ -1,39 +1,26 @@
-import React, { useState, useEffect } from 'react'
+import React from 'react'
import { Marker, Popup } from 'react-leaflet'
-import Fetch from '../../services/Fetch.js'
import MarkerIcon from './MarkerIcon.js'
import PopupContent from './Popup.jsx'
import MarkerClusterGroup from 'react-leaflet-markercluster'
-const Pokestop = ({ bounds }) => {
- const [pokestops, setPokestops] = useState([])
-
- const getPokestops = async (bounds) => {
- if (bounds) setPokestops(await Fetch.fetchPokestops(bounds))
- }
-
- useEffect(() => {
- getPokestops(bounds)
- }, [bounds])
-
- const allPokestops = pokestops.map(pokestop => {
- return (
-
-
-
-
-
- )
- })
-
+const Pokestop = ({ data }) => {
return (
- {allPokestops}
+ {data.map(pokestop => {
+ return (
+
+
+
+
+
+ )
+ })}
)
}
diff --git a/client/src/services/Fetch.js b/client/src/services/Fetch.js
index 7cacc0022..88729b122 100644
--- a/client/src/services/Fetch.js
+++ b/client/src/services/Fetch.js
@@ -1,6 +1,3 @@
-import fetchGyms from './data/gyms.js'
-import fetchPokestops from './data/pokestops.js'
-import fetchPokemon from './data/pokemon.js'
import fetchSettings from './data/settings.js'
class Fetch {
@@ -8,19 +5,7 @@ class Fetch {
static async fetchSettings() {
return await fetchSettings()
}
-
- static async fetchGyms(bounds) {
- return await fetchGyms(bounds)
- }
-
- static async fetchPokestops(bounds) {
- return await fetchPokestops(bounds)
- }
-
- static async fetchPokemon(bounds) {
- return await fetchPokemon(bounds)
- }
-
+
}
export default Fetch
\ No newline at end of file
diff --git a/client/src/services/data/gyms.js b/client/src/services/data/gyms.js
deleted file mode 100644
index 8437c0b1e..000000000
--- a/client/src/services/data/gyms.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export default async function (bounds) {
- const maxLat = bounds._northEast.lat
- const maxLon = bounds._northEast.lng
- const minLat = bounds._southWest.lat
- const minLon = bounds._southWest.lng
- try {
- const response = await fetch(`/api/v1/data/gyms?maxLat=${maxLat}&maxLon=${maxLon}&minLat=${minLat}&minLon=${minLon}`)
- if (!response.ok) {
- throw new Error(`${response.status} (${response.statusText})`)
- }
- const body = await response.json()
- return body.gyms
- } catch (error) {
- console.error(error.message)
- }
-}
\ No newline at end of file
diff --git a/client/src/services/data/pokemon.js b/client/src/services/data/pokemon.js
deleted file mode 100644
index ffb736e05..000000000
--- a/client/src/services/data/pokemon.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export default async function (bounds) {
- const maxLat = bounds._northEast.lat
- const maxLon = bounds._northEast.lng
- const minLat = bounds._southWest.lat
- const minLon = bounds._southWest.lng
- try {
- const response = await fetch(`/api/v1/data/pokemon?maxLat=${maxLat}&maxLon=${maxLon}&minLat=${minLat}&minLon=${minLon}`)
- if (!response.ok) {
- throw new Error(`${response.status} (${response.statusText})`)
- }
- const body = await response.json()
- return body.pokemon
- } catch (error) {
- console.error(error.message)
- }
-}
\ No newline at end of file
diff --git a/client/src/services/data/pokestops.js b/client/src/services/data/pokestops.js
deleted file mode 100644
index a3af8c488..000000000
--- a/client/src/services/data/pokestops.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export default async function (bounds) {
- const maxLat = bounds._northEast.lat
- const maxLon = bounds._northEast.lng
- const minLat = bounds._southWest.lat
- const minLon = bounds._southWest.lng
- try {
- const response = await fetch(`/api/v1/data/pokestops?maxLat=${maxLat}&maxLon=${maxLon}&minLat=${minLat}&minLon=${minLon}`)
- if (!response.ok) {
- throw new Error(`${response.status} (${response.statusText})`)
- }
- const body = await response.json()
- return body.pokestops
- } catch (error) {
- console.error(error.message)
- }
-}
\ No newline at end of file
diff --git a/client/src/services/queries.js b/client/src/services/queries.js
new file mode 100644
index 000000000..730aeefbc
--- /dev/null
+++ b/client/src/services/queries.js
@@ -0,0 +1,27 @@
+import { gql } from '@apollo/client'
+
+const getDataQuery = gql`
+ query Data($minLat: Float!, $minLon: Float!, $maxLat: Float!, $maxLon: Float!) {
+ gyms(minLat: $minLat, minLon: $minLon, maxLat: $maxLat, maxLon: $maxLon) {
+ id
+ lat
+ lon
+ availble_slots
+ team_id
+ in_battle
+ },
+ pokestops(minLat: $minLat, minLon: $minLon, maxLat: $maxLat, maxLon: $maxLon) {
+ id
+ lat
+ lon
+ },
+ pokemon(minLat: $minLat, minLon: $minLon, maxLat: $maxLat, maxLon: $maxLon) {
+ id
+ lat
+ lon
+ pokemon_id
+ }
+ }
+`
+
+export { getDataQuery }
\ No newline at end of file
diff --git a/client/webpack.config.js b/client/webpack.config.js
index 1910f70dd..c6c746270 100644
--- a/client/webpack.config.js
+++ b/client/webpack.config.js
@@ -60,6 +60,7 @@ export default {
]
},
resolve: {
+ mainFields: ['browser','main','module'],
alias: {
...reactDomAlias,
"@Components": path.resolve(__dirname, "src/components/"),
diff --git a/server/package.json b/server/package.json
index ac81451b7..38104c62e 100644
--- a/server/package.json
+++ b/server/package.json
@@ -27,9 +27,13 @@
"webpack-hot-middleware": "^2.25.0"
},
"dependencies": {
+ "cors": "^2.8.5",
"express": "^4.17.1",
+ "express-graphql": "^0.12.0",
"express-handlebars": "^5.2.1",
"extend": "^3.0.2",
+ "graphql": "^15.5.0",
+ "graphql-type-json": "^0.3.2",
"knex": "^0.95.1",
"morgan": "^1.10.0",
"mysql": "^2.18.1",
diff --git a/server/src/index.js b/server/src/index.js
index 9c9a4264a..ee5f8bc21 100644
--- a/server/src/index.js
+++ b/server/src/index.js
@@ -1,10 +1,15 @@
-import express from 'express'
+import express from 'express'
import path, { dirname } from 'path'
import { fileURLToPath } from 'url'
import logger from "morgan"
import '../knexfile.js'
-import rootRouter from './routes/rootRouter.js'
-import addMiddlewares from './middlewares/addMiddlewares.js'
+import rootRouter from './routes/rootRouter.js'
+import addMiddlewares from './middlewares/addMiddlewares.js'
+import hbsMiddleware from "express-handlebars"
+
+import { graphqlHTTP } from 'express-graphql'
+import schema from './schema/schema.js'
+import cors from 'cors'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
@@ -12,8 +17,11 @@ const __dirname = dirname(__filename)
const app = express()
const port = 3000
-
-import hbsMiddleware from "express-handlebars"
+app.use(cors())
+app.use('/graphql', graphqlHTTP({
+ schema,
+ graphiql: true
+}))
app.set("views", path.join(__dirname, "../views"))
app.engine(
diff --git a/server/src/routes/api/v1/dataRouter.js b/server/src/routes/api/v1/dataRouter.js
index 1a63a725d..bddb0799c 100644
--- a/server/src/routes/api/v1/dataRouter.js
+++ b/server/src/routes/api/v1/dataRouter.js
@@ -1,5 +1,4 @@
import express from "express"
-import { Gym, Pokestop, Pokemon } from '../../../models/index.js'
import config from '../../../services/config.js'
const dataRouter = new express.Router()
@@ -16,42 +15,4 @@ dataRouter.get("/settings", async (req, res) => {
}
})
-dataRouter.get("/gyms", async (req, res) => {
- const { minLat, minLon, maxLat, maxLon } = req.query
- try {
- const gyms = await Gym.query()
- .whereBetween('lat', [minLat, maxLat])
- .andWhereBetween('lon', [minLon, maxLon])
- res.status(200).json({ gyms })
- } catch (error) {
- res.status(500).json({ error })
- }
-})
-
-dataRouter.get("/pokestops", async (req, res) => {
- const { minLat, minLon, maxLat, maxLon } = req.query
- try {
- const pokestops = await Pokestop.query()
- .whereBetween('lat', [minLat, maxLat])
- .andWhereBetween('lon', [minLon, maxLon])
- res.status(200).json({ pokestops })
- } catch (error) {
- res.status(500).json({ error })
- }
-})
-
-dataRouter.get("/pokemon", async (req, res) => {
- const { minLat, minLon, maxLat, maxLon } = req.query
- try {
- const ts = Math.floor((new Date).getTime() / 1000)
- const pokemon = await Pokemon.query()
- .where('expire_timestamp', '>=', ts)
- .andWhereBetween('lat', [minLat, maxLat])
- .andWhereBetween('lon', [minLon, maxLon])
- res.status(200).json({ pokemon })
- } catch (error) {
- res.status(500).json({ error })
- }
-})
-
export default dataRouter
\ No newline at end of file
diff --git a/server/src/schema/gym.js b/server/src/schema/gym.js
new file mode 100644
index 000000000..58062a1ca
--- /dev/null
+++ b/server/src/schema/gym.js
@@ -0,0 +1,34 @@
+import { GraphQLObjectType, GraphQLID, GraphQLString, GraphQLInt, GraphQLBoolean, GraphQLFloat } from 'graphql'
+
+export default new GraphQLObjectType({
+ name: 'Gym',
+ fields: () => ({
+ id: { type: GraphQLID },
+ lat: { type: GraphQLFloat },
+ lon: { type: GraphQLFloat },
+ name: { type: GraphQLString },
+ url: { type: GraphQLString },
+ last_modified_timestamp: { type: GraphQLInt },
+ raid_end_timestamp: { type: GraphQLInt },
+ raid_spawn_timestamp: { type: GraphQLInt },
+ raid_battle_timestamp: { type: GraphQLInt },
+ updated: { type: GraphQLInt },
+ raid_pokemon_id: { type: GraphQLInt },
+ guarding_pokemon_id: { type: GraphQLInt },
+ availble_slots: { type: GraphQLInt },
+ team_id: { type: GraphQLInt },
+ raid_level: { type: GraphQLInt },
+ ex_raid_eligible: { type: GraphQLBoolean },
+ in_battle: { type: GraphQLBoolean },
+ raid_pokemon_move_1: { type: GraphQLInt },
+ raid_pokemon_move_2: { type: GraphQLInt },
+ raid_pokemon_form: { type: GraphQLInt },
+ raid_pokemon_cp: { type: GraphQLInt },
+ raid_is_exclusive: { type: GraphQLBoolean },
+ total_cp: { type: GraphQLInt },
+ first_seen_timestamp: { type: GraphQLInt },
+ sponsor_id: { type: GraphQLInt },
+ raid_pokemon_costume: { type: GraphQLInt },
+ raid_pokemon_evolution: { type: GraphQLInt }
+ })
+})
diff --git a/server/src/schema/pokemon.js b/server/src/schema/pokemon.js
new file mode 100644
index 000000000..cde4c50f8
--- /dev/null
+++ b/server/src/schema/pokemon.js
@@ -0,0 +1,44 @@
+import { GraphQLObjectType, GraphQLID, GraphQLList, GraphQLInt, GraphQLFloat } from 'graphql'
+
+const PvpType = new GraphQLObjectType({
+ name: 'Pvp',
+ fields: () => ({
+ level: { type: GraphQLFloat },
+ pokemon: { type: GraphQLInt },
+ form: { type: GraphQLInt },
+ cp: { type: GraphQLInt },
+ percentage: { type: GraphQLFloat }
+ })
+})
+
+export default new GraphQLObjectType({
+ name: 'PokemonDetails',
+ fields: () => ({
+ id: { type: GraphQLID },
+ lat: { type: GraphQLFloat },
+ lon: { type: GraphQLFloat },
+ weight: { type: GraphQLFloat },
+ size: { type: GraphQLFloat },
+ expire_timestamp: { type: GraphQLInt },
+ updated: { type: GraphQLInt },
+ pokemon_id: { type: GraphQLInt },
+ move_1: { type: GraphQLInt },
+ move_2: { type: GraphQLInt },
+ gender: { type: GraphQLInt },
+ cp: { type: GraphQLInt },
+ atk_iv: { type: GraphQLInt },
+ def_iv: { type: GraphQLInt },
+ sta_iv: { type: GraphQLInt },
+ form: { type: GraphQLInt },
+ weather: { type: GraphQLInt },
+ costume: { type: GraphQLInt },
+ first_seen_timestamp: { type: GraphQLInt },
+ changed: { type: GraphQLInt },
+ expire_timestamp_verified: { type: GraphQLInt },
+ capture_1: { type: GraphQLFloat },
+ capture_2: { type: GraphQLFloat },
+ capture_3: { type: GraphQLFloat },
+ greatLeague: { type: new GraphQLList(PvpType) },
+ ultraLeague: { type: new GraphQLList(PvpType) },
+ })
+})
diff --git a/server/src/schema/pokestop.js b/server/src/schema/pokestop.js
new file mode 100644
index 000000000..6942e2341
--- /dev/null
+++ b/server/src/schema/pokestop.js
@@ -0,0 +1,39 @@
+import { GraphQLObjectType, GraphQLID, GraphQLString, GraphQLInt, GraphQLBoolean, GraphQLFloat } from 'graphql'
+import { GraphQLJSON } from 'graphql-type-json'
+
+const QuestType = new GraphQLObjectType({
+ name: 'Conditions',
+ fields: () => ({
+ type: { type: GraphQLInt },
+ info: { type: GraphQLJSON }
+ })
+})
+
+export default new GraphQLObjectType({
+ name: 'Pokestop',
+ fields: () => ({
+ id: { type: GraphQLID },
+ lat: { type: GraphQLFloat },
+ lon: { type: GraphQLFloat },
+ name: { type: GraphQLString },
+ url: { type: GraphQLString },
+ lure_expire_timestamp: { type: GraphQLString },
+ last_modified_timestamp: { type: GraphQLInt },
+ updated: { type: GraphQLInt },
+ quest_type: { type: GraphQLInt },
+ quest_timestamp: { type: GraphQLInt },
+ quest_target: { type: GraphQLInt },
+ quest_conditions: { type: GraphQLJSON },
+ quest_rewards: { type: GraphQLJSON },
+ quest_template: { type: GraphQLString },
+ quest_reward_type: { type: GraphQLInt },
+ quest_item_id: { type: GraphQLInt },
+ lure_id: { type: GraphQLInt },
+ pokestop_display: { type: GraphQLBoolean },
+ incident_expire_timestamp: { type: GraphQLInt },
+ grunt_type: { type: GraphQLInt },
+ first_seen_timestamp: { type: GraphQLInt },
+ sponsor_id: { type: GraphQLInt },
+ quest_pokemon_id: { type: GraphQLInt }
+ })
+})
diff --git a/server/src/schema/schema.js b/server/src/schema/schema.js
new file mode 100644
index 000000000..668521be0
--- /dev/null
+++ b/server/src/schema/schema.js
@@ -0,0 +1,74 @@
+import { GraphQLObjectType, GraphQLID, GraphQLString, GraphQLInt, GraphQLBoolean, GraphQLFloat, GraphQLList, GraphQLSchema } from 'graphql'
+
+import GymType from './gym.js'
+import PokestopType from './pokestop.js'
+import PokemonType from './pokemon.js'
+import { Gym, Pokemon, Pokestop } from '../models/index.js'
+
+const RootQuery = new GraphQLObjectType({
+ name: 'RootQueryType',
+ fields: {
+ gyms: {
+ type: new GraphQLList(GymType),
+ args: {
+ minLat: { type: GraphQLFloat },
+ maxLat: { type: GraphQLFloat },
+ minLon: { type: GraphQLFloat },
+ maxLon: { type: GraphQLFloat }
+ },
+ async resolve(parent, args) {
+ return await Gym.query()
+ .whereBetween('lat', [args.minLat, args.maxLat])
+ .andWhereBetween('lon', [args.minLon, args.maxLon])
+ .andWhere('deleted', false)
+ .andWhere('updated', '>', 0)
+ }
+ },
+ pokestops: {
+ type: new GraphQLList(PokestopType),
+ args: {
+ minLat: { type: GraphQLFloat },
+ maxLat: { type: GraphQLFloat },
+ minLon: { type: GraphQLFloat },
+ maxLon: { type: GraphQLFloat }
+ },
+ async resolve(parent, args) {
+ return await Pokestop.query()
+ .whereBetween('lat', [args.minLat, args.maxLat])
+ .andWhereBetween('lon', [args.minLon, args.maxLon])
+ .andWhere('deleted', false)
+ .andWhere('updated', '>', 0)
+ }
+ },
+ pokemon: {
+ type: new GraphQLList(PokemonType),
+ args: {
+ minLat: { type: GraphQLFloat },
+ maxLat: { type: GraphQLFloat },
+ minLon: { type: GraphQLFloat },
+ maxLon: { type: GraphQLFloat }
+ },
+ async resolve(parent, args) {
+ const ts = Math.floor((new Date).getTime() / 1000)
+ return await Pokemon.query()
+ .where('expire_timestamp', '>=', ts)
+ .andWhereBetween('lat', [args.minLat, args.maxLat])
+ .andWhereBetween('lon', [args.minLon, args.maxLon])
+ }
+ },
+ pokemonDetails: {
+ type: PokemonType,
+ args: {
+ id: { type: GraphQLID }
+ },
+ async resolve(parent, args) {
+ const result = await Pokemon.query().findOne('id', args.id)
+ result.greatLeague = JSON.parse(result.pvp_rankings_great_league)
+ result.ultraLeague = JSON.parse(result.pvp_rankings_ultra_league)
+ return result
+ }
+ }
+ }
+})
+
+export default new GraphQLSchema({ query: RootQuery })
diff --git a/yarn.lock b/yarn.lock
index 7838edc2e..ff2a06f83 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,25 @@
# yarn lockfile v1
+"@apollo/client@^3.3.11":
+ version "3.3.11"
+ resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.3.11.tgz#125051405e83dc899d471d43b79fd6045d92a802"
+ integrity sha512-54+D5FB6RJlQ+g37f432gaexnyvDsG5X6L9VO5kqN54HJlbF8hCf/8CXtAQEHCWodAwZhy6kOLp2RM96829q3A==
+ dependencies:
+ "@graphql-typed-document-node/core" "^3.0.0"
+ "@types/zen-observable" "^0.8.0"
+ "@wry/context" "^0.5.2"
+ "@wry/equality" "^0.3.0"
+ fast-json-stable-stringify "^2.0.0"
+ graphql-tag "^2.12.0"
+ hoist-non-react-statics "^3.3.2"
+ optimism "^0.14.0"
+ prop-types "^15.7.2"
+ symbol-observable "^2.0.0"
+ ts-invariant "^0.6.0"
+ tslib "^1.10.0"
+ zen-observable "^0.8.14"
+
"@babel/code-frame@^7.12.13":
version "7.12.13"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658"
@@ -894,6 +913,13 @@
"@babel/plugin-transform-react-jsx-development" "^7.12.12"
"@babel/plugin-transform-react-pure-annotations" "^7.12.1"
+"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1":
+ version "7.13.10"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.10.tgz#47d42a57b6095f4468da440388fdbad8bebf0d7d"
+ integrity sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==
+ dependencies:
+ regenerator-runtime "^0.13.4"
+
"@babel/runtime@^7.13.9", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.7":
version "7.13.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.13.9.tgz#97dbe2116e2630c489f22e0656decd60aaa1fcee"
@@ -980,6 +1006,11 @@
resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413"
integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==
+"@graphql-typed-document-node/core@^3.0.0":
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950"
+ integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==
+
"@hot-loader/react-dom@^17.0.1":
version "17.0.1"
resolved "https://registry.yarnpkg.com/@hot-loader/react-dom/-/react-dom-17.0.1.tgz#0c75b4dd068f819435dafb3e8809ca1749695656"
@@ -1176,6 +1207,21 @@
dependencies:
"@types/react" "*"
+"@types/ungap__global-this@^0.3.1":
+ version "0.3.1"
+ resolved "https://registry.yarnpkg.com/@types/ungap__global-this/-/ungap__global-this-0.3.1.tgz#18ce9f657da556037a29d50604335614ce703f4c"
+ integrity sha512-+/DsiV4CxXl6ZWefwHZDXSe1Slitz21tom38qPCaG0DYCS1NnDPIQDTKcmQ/tvK/edJUKkmuIDBJbmKDiB0r/g==
+
+"@types/zen-observable@^0.8.0":
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71"
+ integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg==
+
+"@ungap/global-this@^0.4.2":
+ version "0.4.4"
+ resolved "https://registry.yarnpkg.com/@ungap/global-this/-/global-this-0.4.4.tgz#8a1b2cfcd3e26e079a847daba879308c924dd695"
+ integrity sha512-mHkm6FvepJECMNthFuIgpAEFmPOk71UyXuIxYfjytvFTnSDBIz7jmViO+LfHI/AjrazWije0PnSP3+/NlwzqtA==
+
"@webassemblyjs/ast@1.11.0":
version "1.11.0"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.0.tgz#a5aa679efdc9e51707a4207139da57920555961f"
@@ -1314,6 +1360,27 @@
resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.0.tgz#2730c770f5f1f132767c63dcaaa4ec28f8c56a6c"
integrity sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw==
+"@wry/context@^0.5.2":
+ version "0.5.4"
+ resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.5.4.tgz#b6c28038872e0a0e1ff14eb40b5bf4cab2ab4e06"
+ integrity sha512-/pktJKHUXDr4D6TJqWgudOPJW2Z+Nb+bqk40jufA3uTkLbnCRKdJPiYDIa/c7mfcPH8Hr6O8zjCERpg5Sq04Zg==
+ dependencies:
+ tslib "^1.14.1"
+
+"@wry/equality@^0.3.0":
+ version "0.3.4"
+ resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.3.4.tgz#37f101552b18a046d5c0c06da7b2021b15f72c03"
+ integrity sha512-1gQQhCPenzxw/1HzLlvSIs/59eBHJf9ZDIussjjZhqNSqQuPKQIzN6SWt4kemvlBPDi7RqMuUa03pId7MAE93g==
+ dependencies:
+ tslib "^1.14.1"
+
+"@wry/trie@^0.2.1":
+ version "0.2.2"
+ resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.2.2.tgz#99f20f0fcbbcda17006069b155c826cbabfc402f"
+ integrity sha512-OxqBB39x6MfHaa2HpMiRMfhuUnQTddD32Ko020eBeJXq87ivX6xnSSnzKHVbA21p7iqBASz8n/07b6W5wW1BVQ==
+ dependencies:
+ tslib "^1.14.1"
+
"@xtuc/ieee754@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790"
@@ -1334,7 +1401,7 @@ abbrev@1:
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
-accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
+accepts@^1.3.7, accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==
@@ -2000,7 +2067,7 @@ content-disposition@0.5.3:
dependencies:
safe-buffer "5.1.2"
-content-type@~1.0.4:
+content-type@^1.0.4, content-type@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==
@@ -2040,6 +2107,14 @@ core-util-is@~1.0.0:
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
+cors@^2.8.5:
+ version "2.8.5"
+ resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
+ integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
+ dependencies:
+ object-assign "^4"
+ vary "^1"
+
cross-spawn@^6.0.0:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
@@ -2546,6 +2621,16 @@ expand-brackets@^2.1.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"
+express-graphql@^0.12.0:
+ version "0.12.0"
+ resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.12.0.tgz#58deabc309909ca2c9fe2f83f5fbe94429aa23df"
+ integrity sha512-DwYaJQy0amdy3pgNtiTDuGGM2BLdj+YO2SgbKoLliCfuHv3VVTt7vNG/ZqK2hRYjtYHE2t2KB705EU94mE64zg==
+ dependencies:
+ accepts "^1.3.7"
+ content-type "^1.0.4"
+ http-errors "1.8.0"
+ raw-body "^2.4.1"
+
express-handlebars@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/express-handlebars/-/express-handlebars-5.2.1.tgz#f38d85e4746ee3ce2b12a381352878a502af4ddd"
@@ -2907,6 +2992,23 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6:
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
+graphql-tag@^2.12.0:
+ version "2.12.1"
+ resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.1.tgz#b065ef885e4800e4afd0842811b718a205f4aa58"
+ integrity sha512-LPewEE1vzGkHnCO8zdOGogKsHHBdtpGyihow1UuMwp6RnZa0lAS7NcbvltLOuo4pi5diQCPASAXZkQq44ffixA==
+ dependencies:
+ tslib "^1.14.1"
+
+graphql-type-json@^0.3.2:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/graphql-type-json/-/graphql-type-json-0.3.2.tgz#f53a851dbfe07bd1c8157d24150064baab41e115"
+ integrity sha512-J+vjof74oMlCWXSvt0DOf2APEdZOCdubEvGDUAlqH//VBYcOYsGgRW7Xzorr44LvkjiuvecWc8fChxuZZbChtg==
+
+graphql@^15.5.0:
+ version "15.5.0"
+ resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.0.tgz#39d19494dbe69d1ea719915b578bf920344a69d5"
+ integrity sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA==
+
handle-thing@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e"
@@ -2987,7 +3089,19 @@ he@^1.2.0:
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
-hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
+history@^4.9.0:
+ version "4.10.1"
+ resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
+ integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
+ dependencies:
+ "@babel/runtime" "^7.1.2"
+ loose-envify "^1.2.0"
+ resolve-pathname "^3.0.0"
+ tiny-invariant "^1.0.2"
+ tiny-warning "^1.0.0"
+ value-equal "^1.0.1"
+
+hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
@@ -3067,17 +3181,7 @@ http-errors@1.7.2:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"
-http-errors@~1.6.2:
- version "1.6.3"
- resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d"
- integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=
- dependencies:
- depd "~1.1.2"
- inherits "2.0.3"
- setprototypeof "1.1.0"
- statuses ">= 1.4.0 < 2"
-
-http-errors@~1.7.2:
+http-errors@1.7.3, http-errors@~1.7.2:
version "1.7.3"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06"
integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==
@@ -3088,6 +3192,27 @@ http-errors@~1.7.2:
statuses ">= 1.5.0 < 2"
toidentifier "1.0.0"
+http-errors@1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507"
+ integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==
+ dependencies:
+ depd "~1.1.2"
+ inherits "2.0.4"
+ setprototypeof "1.2.0"
+ statuses ">= 1.5.0 < 2"
+ toidentifier "1.0.0"
+
+http-errors@~1.6.2:
+ version "1.6.3"
+ resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d"
+ integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=
+ dependencies:
+ depd "~1.1.2"
+ inherits "2.0.3"
+ setprototypeof "1.1.0"
+ statuses ">= 1.4.0 < 2"
+
http-parser-js@>=0.5.1:
version "0.5.3"
resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9"
@@ -3481,6 +3606,11 @@ is-yarn-global@^0.3.0:
resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232"
integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==
+isarray@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
+ integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
+
isarray@1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -3767,7 +3897,7 @@ loglevel@^1.6.8:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197"
integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==
-loose-envify@^1.1.0, loose-envify@^1.4.0:
+loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -3930,6 +4060,14 @@ min-document@^2.19.0:
dependencies:
dom-walk "^0.1.0"
+mini-create-react-context@^0.4.0:
+ version "0.4.1"
+ resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e"
+ integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==
+ dependencies:
+ "@babel/runtime" "^7.12.1"
+ tiny-warning "^1.0.3"
+
mini-css-extract-plugin@^1.3.9:
version "1.3.9"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.9.tgz#47a32132b0fd97a119acd530e8421e8f6ab16d5e"
@@ -4146,7 +4284,7 @@ nth-check@^1.0.2:
dependencies:
boolbase "~1.0.0"
-object-assign@^4.0.1, object-assign@^4.1.1:
+object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
@@ -4243,6 +4381,14 @@ opn@^5.5.0:
dependencies:
is-wsl "^1.1.0"
+optimism@^0.14.0:
+ version "0.14.1"
+ resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.14.1.tgz#db35a0c770e16863f6c288f7cf58341a2348db44"
+ integrity sha512-7+1lSN+LJEtaj3uBLLFk8uFCFKy3txLvcvln5Dh1szXjF9yghEMeWclmnk0qdtYZ+lcMNyu48RmQQRw+LRYKSQ==
+ dependencies:
+ "@wry/context" "^0.5.2"
+ "@wry/trie" "^0.2.1"
+
original@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f"
@@ -4391,6 +4537,13 @@ path-to-regexp@0.1.7:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
+path-to-regexp@^1.7.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
+ integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
+ dependencies:
+ isarray "0.0.1"
+
pg-connection-string@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.4.0.tgz#c979922eb47832999a204da5dbe1ebf2341b6a10"
@@ -4625,6 +4778,16 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
+raw-body@^2.4.1:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.1.tgz#30ac82f98bb5ae8c152e67149dac8d55153b168c"
+ integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==
+ dependencies:
+ bytes "3.1.0"
+ http-errors "1.7.3"
+ iconv-lite "0.4.24"
+ unpipe "1.0.0"
+
rc@^1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -4658,7 +4821,7 @@ react-hot-loader@^4.13.0:
shallowequal "^1.1.0"
source-map "^0.7.3"
-react-is@^16.7.0, react-is@^16.8.1:
+react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -4690,6 +4853,35 @@ react-lifecycles-compat@^3.0.4:
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
+react-router-dom@^5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
+ integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
+ dependencies:
+ "@babel/runtime" "^7.1.2"
+ history "^4.9.0"
+ loose-envify "^1.3.1"
+ prop-types "^15.6.2"
+ react-router "5.2.0"
+ tiny-invariant "^1.0.2"
+ tiny-warning "^1.0.0"
+
+react-router@5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
+ integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
+ dependencies:
+ "@babel/runtime" "^7.1.2"
+ history "^4.9.0"
+ hoist-non-react-statics "^3.1.0"
+ loose-envify "^1.3.1"
+ mini-create-react-context "^0.4.0"
+ path-to-regexp "^1.7.0"
+ prop-types "^15.6.2"
+ react-is "^16.6.0"
+ tiny-invariant "^1.0.2"
+ tiny-warning "^1.0.0"
+
react-transition-group@^4.0.0, react-transition-group@^4.4.0:
version "4.4.1"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.1.tgz#63868f9325a38ea5ee9535d828327f85773345c9"
@@ -4901,6 +5093,11 @@ resolve-from@^5.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
+resolve-pathname@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
+ integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
+
resolve-url@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
@@ -5132,6 +5329,11 @@ setprototypeof@1.1.1:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683"
integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==
+setprototypeof@1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
+ integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
+
shallow-clone@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"
@@ -5432,6 +5634,11 @@ symbol-observable@1.2.0:
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==
+symbol-observable@^2.0.0:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a"
+ integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==
+
tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b"
@@ -5487,7 +5694,12 @@ tildify@2.0.0:
resolved "https://registry.yarnpkg.com/tildify/-/tildify-2.0.0.tgz#f205f3674d677ce698b7067a99e949ce03b4754a"
integrity sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==
-tiny-warning@^1.0.2:
+tiny-invariant@^1.0.2:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
+ integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==
+
+tiny-warning@^1.0.0, tiny-warning@^1.0.2, tiny-warning@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
@@ -5546,7 +5758,16 @@ touch@^3.1.0:
dependencies:
nopt "~1.0.10"
-tslib@^1.9.0:
+ts-invariant@^0.6.0:
+ version "0.6.1"
+ resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.6.1.tgz#eb4c52b45daaca8367abbfd6cff998ea871d592d"
+ integrity sha512-QQgN33g8E8yrdDuH29HASveLtbzMnRRgWh0i/JNTW4+zcLsdIOnfsgEDi/NKx4UckQyuMFt9Ujm6TWLWQ58Kvg==
+ dependencies:
+ "@types/ungap__global-this" "^0.3.1"
+ "@ungap/global-this" "^0.4.2"
+ tslib "^1.9.3"
+
+tslib@^1.10.0, tslib@^1.14.1, tslib@^1.9.0, tslib@^1.9.3:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
@@ -5735,7 +5956,12 @@ v8-compile-cache@^2.2.0:
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132"
integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==
-vary@~1.1.2:
+value-equal@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
+ integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
+
+vary@^1, vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
@@ -6032,3 +6258,8 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
+
+zen-observable@^0.8.14:
+ version "0.8.15"
+ resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
+ integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==
From 2ec7d09ec0368f56c980c67672674d5d2f69a082 Mon Sep 17 00:00:00 2001
From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>
Date: Wed, 10 Mar 2021 00:32:09 -0500
Subject: [PATCH 2/2] Cleanup
---
client/src/components/App.js | 2 --
client/webpack.config.js | 1 -
2 files changed, 3 deletions(-)
diff --git a/client/src/components/App.js b/client/src/components/App.js
index 7b234acf5..0b3af2b22 100644
--- a/client/src/components/App.js
+++ b/client/src/components/App.js
@@ -6,7 +6,6 @@ import "../assets/scss/main.scss"
import { MapContainer } from 'react-leaflet'
import MapTiles from './MapTiles.jsx'
import Fetch from '../services/Fetch.js'
-import Navbar from './layout/Navbar.jsx'
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client'
@@ -31,7 +30,6 @@ const App = props => {
return (
-
{settings &&
diff --git a/client/webpack.config.js b/client/webpack.config.js
index c6c746270..bf5d720db 100644
--- a/client/webpack.config.js
+++ b/client/webpack.config.js
@@ -1,7 +1,6 @@
import path, { dirname } from 'path'
import { fileURLToPath } from 'url'
import HtmlWebpackPlugin from "html-webpack-plugin"
-import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import webpack from 'webpack'