How to use the apollo-server-cache-memcached.MemcachedCache function in apollo-server-cache-memcached

To help you get started, we’ve selected a few apollo-server-cache-memcached examples, based on popular ways it is used in public projects.

github chnirt / nestjs-graphql-best-practice / src / graphql.config.service.ts View on Github external
},
    };

    return {
      typePaths: ['./**/*.graphql'],
      directiveResolvers,
      context: ({ req, connection }) =>
        connection ? { req: connection.context } : { req },
      debug: false,
      subscriptions: {
        onConnect: (connectionParams, webSocket, context) => {
          console.log('🔗 Connected to websocket');
        },
      },
      persistedQueries: {
        cache: new MemcachedCache(
          ['memcached-server-1', 'memcached-server-2', 'memcached-server-3'],
          { retries: 10, retry: 10000 }, // Options
        ),
      },
      installSubscriptionHandlers: true,
      introspection: true,
      playground: {
        settings: {
          'editor.cursorShape': 'line', // possible values: 'line', 'block', 'underline'
          'editor.fontFamily': `'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace`,
          'editor.fontSize': 14,
          'editor.reuseHeaders': true, // new tab reuses headers from last tab
          'editor.theme': 'dark', // possible values: 'dark', 'light'
          'general.betaUpdates': false,
          'queryPlan.hideQueryPlanResponse': false,
          'request.credentials': 'include', // possible values: 'omit', 'include', 'same-origin'
github chnirt / nestjs-graphql-best-practice / src / config / graphql / index.ts View on Github external
const { initPromise } = context
					const { currentUser } = await initPromise

					await getMongoRepository(User).updateOne(
						{ _id: currentUser._id },
						{
							$set: { isOnline: false },
						},
						{
							upsert: true,
						}
					)
				},
			},
			persistedQueries: {
				cache: new MemcachedCache(
					['memcached-server-1', 'memcached-server-2', 'memcached-server-3'],
					{ retries: 10, retry: 10000 } // Options
				),
			},
			installSubscriptionHandlers: true,
			// uploads: false
		}
	}
}
github chnirt / nestjs-graphql-best-practice / src / config / graphql / index.ts View on Github external
const { initPromise } = context
					const { currentUser } = await initPromise

					await getMongoRepository(User).updateOne(
						{ _id: currentUser._id },
						{
							$set: { isOnline: false }
						},
						{
							upsert: true
						}
					)
				}
			},
			persistedQueries: {
				cache: new MemcachedCache(
					['memcached-server-1', 'memcached-server-2', 'memcached-server-3'],
					{ retries: 10, retry: 10000 } // Options
				)
			},
			installSubscriptionHandlers: true,
			uploads: {
				maxFieldSize: 2, // 1mb
				maxFileSize: 20, // 20mb
				maxFiles: 5
			}
		}
	}
}

apollo-server-cache-memcached

[![npm version](https://badge.fury.io/js/apollo-server-cache-memcached.svg)](https://badge.fury.io/js/apollo-server-cache-memcached) [![Build Status](https://circleci.com/gh/apollographql/apollo-server/tree/main.svg?style=svg)](https://circleci.com/gh/apo

MIT
Latest version published 9 months ago

Package Health Score

82 / 100
Full package analysis

Popular apollo-server-cache-memcached functions

Similar packages