Lots of this is just copied from the relay docs.
- relay.dev
- Example Graphql Schema used in many examples from the relay.dev docs
Lots of this is just copied from the relay docs.
| package graphql.models | |
| import java.text.DecimalFormat | |
| import sangria.validation.ValueCoercionViolation | |
| import json.SprayJsonConversions | |
| import sangria.macros.derive.{ | |
| deriveObjectType, AddFields, ObjectTypeDescription, ObjectTypeName | |
| } |
| trait CartTypes { | |
| implicit val ec: ExecutionContextExecutor | |
| val itemType: ObjectType[RequestServices, Item] | |
| lazy val cartType: ObjectType[Unit, Cart] = ObjectType[RequestServices, Cart]( | |
| /* ... */ | |
| fields = Field( | |
| "items", | |
| ListType(ItemType), |
| " |
in:inbox older_than:7d -is:starred
cc:me older_than:3d -is:starred
| # Nesting would not work here but could easily be tweaked to do so | |
| # other hash methods that return a copy (eg #merge) also need to be reimplemented | |
| # OpenStruct already does this too btw | |
| class HashObj < SimpleDelegator | |
| def method_missing(method_name, *args, &block) | |
| if __getobj__.keys.include?(method_name) | |
| puts "looking for #{method_name}" | |
| __getobj__[method_name] |
| # naive script to read a text file and | |
| # extract what look like apa citations from parentheses, | |
| # then split them on `;` to pull out groups of citations | |
| # and finally write them to a text file. | |
| # usage: `python extractor.py ./some-text.txt` | |
| import sys | |
| import re | |