Skip to content
Permalink
Browse files

Update Webpack:typescript/graphql/loader

  • Loading branch information...
shfshanyue committed Aug 5, 2019
1 parent eefb0ac commit fc59b3600c52fa106b224a2215734903fb58bd69
@@ -2,7 +2,7 @@ import React from 'react'
import Skeleton from './Skeleton'

interface Props {
children: React.ReactElement;
children: any;
loading?: boolean;
title?: string;
}
@@ -18,7 +18,7 @@ function Card ({ children, loading, title }: Props) {
}
<div className={`card ${loading ? 'loading' : ''}`}>
<Skeleton loading={loading}>
{children}
{ children }
</Skeleton>
</div>
<style jsx>{`
@@ -6,7 +6,7 @@ import { Router, Link } from '../routes'

import Search from './Search'
import Avator from './Avator'
import { ME } from '../query.gql'
import { ME } from '../query/index.gql'

class Header extends Component {
constructor (props) {
@@ -6,7 +6,7 @@ import 'dayjs/locale/zh-cn'
import { Link, Router } from '../routes'
import Tag from '../components/Tag'
import { get, highlight, slice } from '../lib/utils'
import { STAR_POEM, RECITE_POEM } from '../query.gql'
import { STAR_POEM, RECITE_POEM } from '../query/index.gql'

import dayjs from 'dayjs'
dayjs.extend(relativeTime)
@@ -1,5 +1,7 @@
import React from 'react'

interface Props {
children: React.ReactElement;
children?: any;
loading?: boolean;
line?: number;
}
@@ -1,7 +1,7 @@
import React from 'react'
import { graphql, compose } from 'react-apollo'
import { Link } from '../routes'
import { TAGS } from '../query.gql'
import { TAGS } from '../query/index.gql'
import { groupBy, get } from '../lib/utils'

import Tag from './Tag'
@@ -30,7 +30,7 @@ module.exports = {
}

config.module.rules.push({
test: /\.(graphql|gql)$/,
test: /\.gql$/,
exclude: /node_modules/,
use: {
loader: 'graphql-tag/loader'

Some generated files are not rendered by default. Learn more.

@@ -34,6 +34,7 @@
"@graphql-codegen/typescript": "1.4.0",
"@graphql-codegen/typescript-operations": "1.4.0",
"@graphql-codegen/typescript-react-apollo": "1.4.0",
"babel-plugin-import-graphql": "^2.7.0",
"nodemon": "^1.19.1",
"npm-check-updates": "^3.1.20",
"typescript": "^3.5.3"
@@ -11,7 +11,7 @@ import Poem from '../../components/Poem'
import Pagination from '../../components/Pagination'
import AuthorComponent from '../../components/Author'

import { AUTHOR, AUTHOR_POEMS } from '../../query.gql'
import { AUTHOR, AUTHOR_POEMS } from '../../query/index.gql'

class Author extends Component {
static async getInitialProps({ query }) {
@@ -11,7 +11,7 @@ import Pagination from '../../components/Pagination'
import Author from '../../components/Author'
import Tags from '../../components/Tags'

import { AUTHORS } from '../../query.gql'
import { AUTHORS } from '../../query/index.gql'

class Authors extends Component {
static async getInitialProps({ query }) {
@@ -9,7 +9,7 @@ import { Link, Router } from '../../routes'
import App from '../../components/App'
import Card from '../../components/Card'

import { REGISTER, LOGIN, SEND_VERIFY_CODE, ME } from '../../query.gql'
import { REGISTER, LOGIN, SEND_VERIFY_CODE, ME } from '../../query/index.gql'

class Login extends Component {
constructor (props) {
@@ -11,7 +11,7 @@ import Tags from '../../components/Tags'
import Card from '../../components/Card'
import Pagination from '../../components/Pagination'

import { PHRASES } from '../../query.gql'
import { PHRASES } from '../../query/index.gql'

class Phrases extends Component {
static async getInitialProps({ query }) {
@@ -10,7 +10,7 @@ import Author from '../../components/Author'

import PoemComponent from '../../components/Poem'
import { Link } from '../../routes'
import { POEM, POEM_USER_STAR, POEMS } from '../../query.gql'
import { POEM, POEM_USER_STAR, POEMS } from '../../query/index.gql'

class Poem extends Component {
static async getInitialProps({ query }) {
@@ -13,7 +13,7 @@ import Poem from '../../components/Poem'
import Tag from '../../components/Tag'
import Tags from '../../components/Tags'

import { POEMS, POEMS_USER_STAR, RECITE_POEM, STAR_POEM } from '../../query.gql'
import { POEMS, POEMS_USER_STAR, RECITE_POEM, STAR_POEM } from '../../query/index.gql'

class Poems extends Component {
static async getInitialProps({ query }) {
@@ -9,7 +9,7 @@ import App from '../../components/App'
import QR from '../../components/QR'
import Card from '../../components/Card'

import { STAR_POEMS, RECITE_POEMS } from '../../query.gql'
import { STAR_POEMS, RECITE_POEMS } from '../../query/index.gql'

class Profile extends Component {
static async getInitialProps({ query }) {
@@ -0,0 +1,6 @@
declare module '*.gql' {
import { DocumentNode } from 'graphql'

const value: DocumentNode
export = value
}
File renamed without changes.

0 comments on commit fc59b36

Please sign in to comment.
You can’t perform that action at this time.