Skip to content

Instantly share code, notes, and snippets.

View sebas5384's full-sized avatar
🏠
Working from home

Sebastian sebas5384

🏠
Working from home
View GitHub Profile
@sebas5384
sebas5384 / compositions.js
Last active May 28, 2019 23:22
Recompose HoCs for Next.js
/**
* Check if code is running on production mode.
*/
export const isProduction = () =>
typeof process !== "undefined" && process.env.NODE_ENV === "production"
/**
* Check if code is running on development mode.
*/
export const isDevelopment = !isProduction()
@sebas5384
sebas5384 / UserLogin.php
Created October 2, 2019 22:40
Drupal GraphQL Cookie Login
<?php
namespace Drupal\graphql_cookie\Plugin\GraphQL\Mutations;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\graphql\Plugin\GraphQL\Mutations\MutationPluginBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use GraphQL\Type\Definition\ResolveInfo;