Skip to content

Instantly share code, notes, and snippets.

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

Mateu Aguiló Bosch e0ipso

🏠
Working from home
View GitHub Profile
@e0ipso
e0ipso / contenta.gql
Last active October 12, 2018 12:59
Example schema with auto-resolvers from OpenAPI definitions
type Recipe {
id: String!
title: String!
author: User!
}
type User {
id: String!
name: String!
recipes: [Recipe]
}
@e0ipso
e0ipso / api-first-priorities.md
Last active October 13, 2017 15:14
API-First Priorities
@e0ipso
e0ipso / uuid-setter.php
Created March 11, 2017 10:44
Allow setting the UUID from the front-end
<?php
/**
* Implements hook_entity_property_info_alter().
*/
function mymodule_entity_property_info_alter(&$info) {
// Add the uuid setter if not present.
foreach (entity_get_info() as $entity_type => $entity_info) {
if (
!empty($entity_info['uuid'])

Status

This extension was developed as part of the jsonapi module for Drupal.

Introduction

The JSON API specification is agnostic about how a server implements filtering strategies. In fact, the spec says:

Note: JSON API is agnostic about the strategies supported by a server. The filter query parameter can be used as the basis for any number of filtering strategies.

Status

This extension was developed as part of the jsonapi module for Drupal.

Introduction

It is possible for a server to have mixed success and error responses when dealing with a single or multiple entities at once. For instance, when generating collections of resource entities there is a chance that the GET operation results in a partial success. That is because each entity can generate errors independently from the other. In such scenarios the server MAY respond to the request with a partial success response.

Servers and clients MUST negotiate support for and use of the Partial Success extension as described in the base specification using partialsuccess as the name of the extension.

@e0ipso
e0ipso / JSONAPI Authenticated
Created September 16, 2016 13:02
JSONAPI and RESTful Web Services performance comparison
====================================================================================================
AUTHENTICATED
====================================================================================================
>$ ab -v1 -k -c8 -n10 -A admin:admin http://d8dev.local/api/node/article/900b681b-581a-4624-9ff6-99cc865df429\?_format\=api_json\&include\=uid,uid.user_picture,field_tags
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking d8dev.local (be patient).....done
@e0ipso
e0ipso / environment-install.md
Last active September 12, 2016 07:31 — forked from alefi87/environment-install.md
OS X 10.10 Yosemite, Apache, PHP 5.6, MySQL, Memcache, SSL setup with Homebrew

Keybase proof

I hereby claim:

  • I am e0ipso on github.
  • I am e0ipso (https://keybase.io/e0ipso) on keybase.
  • I have a public key whose fingerprint is 1AC6 C4F0 DE21 355A 8D1F FE1E 3ED2 1A07 EE8E 660B

To claim this, I am signing this object: