Skip to content

Commit

Permalink
prettier fix and configured .prettierignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushtiwari110 committed Oct 7, 2023
1 parent 062220b commit 6911efd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Empty file removed .preetierignore
Empty file.
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.github/workflows/actions.yml
.eslintrc.json
.prettierrc.json
.storybook/
.vscode/settings.json
package.json
package-lock.json
README.md
src/stories/
tailwind.config.js
15 changes: 10 additions & 5 deletions src/app/api/graphql/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { startServerAndCreateNextHandler } from '@as-integrations/next'
import { ApolloServer } from '@apollo/server'
import {
ApolloServerPluginLandingPageLocalDefault,
ApolloServerPluginLandingPageProductionDefault
} from '@apollo/server/plugin/landingPage/default';
ApolloServerPluginLandingPageProductionDefault,
} from '@apollo/server/plugin/landingPage/default'
import { gql } from 'graphql-tag'
import { MongoClient } from 'mongodb'

Expand Down Expand Up @@ -41,10 +41,15 @@ const typeDefs = gql`
}
`

let plugins = [];
let plugins = []
//Next.js auto assigns NODE_ENV value as development for 'next dev' command, and production for other commands
if (process.env.NODE_ENV === 'production') {
plugins = [ApolloServerPluginLandingPageProductionDefault({ embed: true, graphRef: 'bacpac-gql@current' })]
plugins = [
ApolloServerPluginLandingPageProductionDefault({
embed: true,
graphRef: 'bacpac-gql@current',
}),
]
} else {
plugins = [ApolloServerPluginLandingPageLocalDefault({ embed: true })]
}
Expand All @@ -57,4 +62,4 @@ const server = new ApolloServer({

const handler = startServerAndCreateNextHandler(server)

export { handler as GET, handler as POST }
export { handler as GET, handler as POST }

0 comments on commit 6911efd

Please sign in to comment.