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
diff --git a/Gemfile.lock b/Gemfile.lock | |
index 7ffd2aa..7672539 100644 | |
--- a/Gemfile.lock | |
+++ b/Gemfile.lock | |
@@ -5,12 +5,16 @@ GEM | |
daemons (1.2.4) | |
eventmachine (1.2.3) | |
kgio (2.11.0) | |
- libv8 (5.7.492.65.1-x86_64-darwin-16) | |
+ libv8 (3.16.14.19) |
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
function parse(query) { | |
var curTerm = null | |
var curPhrase = null | |
var curKey = null | |
var result = [] | |
for (var char of query) { | |
switch (char) { | |
case '"': | |
if (curPhrase != null) { | |
if (curKey) { |
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
fragment StoryData { | |
title: String | |
image: Image | |
body: RichText | |
... | |
} | |
enum StoryStatus { | |
DRAFT | |
PENDING_APPROVAL |
This file has been truncated, but you can view the full file.
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
irb(main):041:0> e.publish | |
D, [2017-10-10T21:19:36.924658 #12604] DEBUG -- : EntryMetadata Load (0.7ms) SELECT `entry_metadatas`.* FROM `entry_metadatas` WHERE `entry_metadatas`.`entry_id` = 16127555 LIMIT 1 | |
D, [2017-10-10T21:19:36.927315 #12604] DEBUG -- : (0.4ms) BEGIN | |
W, [2017-10-10T21:19:36.927601 #12604] WARN -- : save_entry_changes begin 1 transaction_stack: RealTransaction:nil:nil | |
D, [2017-10-10T21:19:36.933759 #12604] DEBUG -- : (0.9ms) SELECT COUNT(*) FROM `entries` INNER JOIN `stack_memberships` ON `entries`.`id` = `stack_memberships`.`card_id` WHERE `entries`.`type` IN ('Card', 'MapCard', 'ExplainerCard') AND `stack_memberships`.`stack_id` = 16127555 AND `entries`.`type` IN ('Card', 'MapCard', 'ExplainerCard') AND `entries`.`type` = 'MapCard' | |
D, [2017-10-10T21:19:36.950121 #12604] DEBUG -- : Status Load (0.4ms) SELECT `statuses`.* FROM `statuses` WHERE `statuses`.`id` = 1 LIMIT 1 | |
D, [2017-10-10T21:19:36.954371 #12604] DEBUG -- : User Load (0.6ms) SELECT `users`.* FROM `users` WH |
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
+ hello | |
- | |
- | |
(1 empty line) |
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
entry(id: 1234) { | |
bylines { | |
name | |
url | |
} | |
} | |
# The API knows to fetch from various database sources, | |
# and returns full names vs usernames according to community rules, | |
# but leaves the formatting as HTML, and comma-joining up to the client |
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
# in tower: | |
query { | |
volumeProjects(communityId: 441, q: "Hillary") { | |
name # from volume api | |
contributorIds # from volume api, chorus user ids of the video's "contributors" (not sure if this is a thing, just an example) | |
contributors { | |
fullName # from sbn api, able to be efficiently resolved by batching multiple user-by-ids queries. | |
} | |
} |
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
diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb | |
index 2e300fc0..02592ea2 100644 | |
--- a/app/controllers/graphql_controller.rb | |
+++ b/app/controllers/graphql_controller.rb | |
@@ -9,6 +9,15 @@ def execute | |
} | |
result = HermanoGraphQL.schema.execute(query, variables: variables, context: context, operation_name: operation_name) | |
render json: result | |
+ rescue StandardError => e | |
+ e = e.cause while e.cause |
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
can user u perform operation o in scope s? | |
1. scopes = [s].concat(s.parents) | |
2. roles = RoleAssignment.where(user: u, scope: scopes).pluck(:role) | |
3. roles.any? { |role| ROLE_OPERATIONS_MAPPING[role].operations.include?(o) } | |
## or perhaps | |
1. scopes = [s].concat(s.parents) |
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
{ | |
"data": { | |
"community": null | |
}, | |
"errors": [ | |
{ | |
"message": "Expected a value of type \"EntryType\" but received: MAP_STACK", | |
"locations": [ | |
{ | |
"line": 3, |