This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
from django.db.models import Prefetch, QuerySet | |
import attr | |
import graphene | |
from cursor_pagination import CursorPaginator | |
from graphene.utils.str_converters import to_snake_case | |
from graphql_relay import connection_from_list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements all the behaviors of moment.fromNow(). Pass a | |
* valid JavaScript Date object and the method will return the | |
* time that has passed since that date in a human-readable | |
* format. Passes the moment test suite for `fromNow()`. | |
* See: https://momentjs.com/docs/#/displaying/fromnow/ | |
* | |
* @example | |
* | |
* var pastDate = new Date('2017-10-01T02:30'); |