graphql-playground icon indicating copy to clipboard operation
graphql-playground copied to clipboard

How to set playground only for specific env?

Open lfaz opened this issue 2 years ago • 0 comments

I tried something like:

 app.get(
        '/playground',
        expressPlayground({
            endpoint: '/graphql',
            env: 'development'
        })
  );

Obviously doesnt seem to work. I could

I could make it work smth like:

    if (process.env.NODE_ENV === 'development') {
        app.get(
            '/playground',
            expressPlayground({
                endpoint: '/graphql',
            })
        );
    }

but to me doesnt seem very nice solution.

lfaz avatar May 09 '22 12:05 lfaz