- NewRelic::Agent
- NewRelic::Agent::Agent
- NewRelic::Agent::EventListener
- NewRelic::Agent::Harvester
- NewRelic::Agent::EventLoop
- NewRelic::Agent::Threading::AgentThread
This file contains 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
class ExceptFilter | |
def self.call(schema_member, context) | |
if schema_member.name == "someField" | |
return context[:some_beta_feature] | |
end | |
if schema_member.name == "bankAccount" | |
return context[:current_user].hasAccessToBankAccount? | |
end | |
This file contains 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
# Execute a query with an `except` or `only` argument | |
MySchema.execute(query_string, except: ExceptFilter) | |
# The except argument here takes any object that responds to call with two arguments: | |
# schema_member: a member from your schema. It may be a Field, ObjectType, Argument, etc. | |
# context: The Query Context | |
class ExceptFilter | |
def self.call(schema_member, context) | |
# true if field should be excluded, false if it should be included |
This file contains 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
module Graph | |
module Types | |
Query = GraphQL::ObjectType.define do | |
name "Query" | |
description "The query root of this schema" | |
field :film, Graph::Types::Film do | |
argument :id, !types.ID | |
resolve ->(_, args, _) { Film.find_by(id: args[:id]) } | |
end |
This file contains 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
module Graph | |
module Types | |
Film = GraphQL::ObjectType.define do | |
name "Film" | |
description "A single film." | |
field :title, !types.String, "The title of this film" | |
end | |
end | |
end |
This file contains 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
query { | |
firstFilm: film(id: "1") { | |
title | |
} | |
secondFilm: film(id: "2") { | |
title | |
} | |
} |
This file contains 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
// Sample ActionCable ES6 client | |
// | |
// To be used like: | |
// | |
// const myEventHandlerFunction = (event) => { | |
// console.log(event.message); | |
// } | |
// | |
// ActionCableClient.connect( | |
// 'ws://localhost:3000/cable', |
This file contains 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
// PROTOTYPAL INHERITANCE | |
// In prototypal languages you only have objects. No classes! | |
// ex nihilo | |
const object = Object.create(null); | |
console.log(object); |
This file contains 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
module Mutations | |
class MarkPullRequestAsReviewed < Graph::Relay::Mutation | |
class Resolver | |
class << self | |
def call(obj, args, ctx) | |
pr = PullRequest.find(args["pullRequestId"]) | |
pr.update!(reviewed: true) | |
{ pullRequest: pr } | |
end | |
end |