Skip to content

Instantly share code, notes, and snippets.

View paramsinghvc's full-sized avatar
💭
I may be slow to respond.

Parminder Singh paramsinghvc

💭
I may be slow to respond.
View GitHub Profile
export function useMeQuery(baseOptions?: Apollo.QueryHookOptions<MeQuery, MeQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MeQuery, MeQueryVariables>(MeDocument, options);
}
schema: schema.graphql
overwrite: true
documents: "./src/**/*.gql"
generates:
./src/shared/generated/graphql.tsx:
plugins:
- typescript
- typescript-operations
- typescript-react-apollo
config:
query me {
me {
id
displayName
albums {
name
photos {
name
}
# ------------------------------------------------------
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type User {
id: String!
displayName: String!
description: String!
dob: DateTime!
photos: [Photo!]!
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
@Module({
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
}),
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
@Module({
imports: [
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
debug: false,
playground: false,
import { Parent, Query, ResolveField, Resolver } from '@nestjs/graphql';
import { AlbumService } from '@src/album/album.service';
import { Album } from '@src/album/entities/album.entity';
import { Photo } from '@src/photo/entities/photo.entity';
import { PhotoService } from '@src/photo/photo.service';
import { User } from './entities/user.entity';
import { UserService } from './user.service';
query weather {
weather {
id
current {
temp
weather {
id
main
}
}
query weather {
weather {
id
current {
temp
weather {
id
main
}
}
type WeatherObject {
id: Int
main: String
}
type CurrentWeather {
temp: Float
weather: [WeatherObject]!
}