Skip to content

Instantly share code, notes, and snippets.

View nilshartmann's full-sized avatar
🐿️
https://graphql.schule

Nils Hartmann nilshartmann

🐿️
https://graphql.schule
View GitHub Profile
@nilshartmann
nilshartmann / DeprecationInstrumentation.java
Last active September 10, 2022 06:22
Write usage of deprecated GraphQL fields to extensions field and dump on browser console (graphql-java/Spring for GraphQL, Apollo Client)
package nh.publy.backend.util;
import graphql.ExecutionResult;
import graphql.ExecutionResultImpl;
import graphql.execution.instrumentation.InstrumentationContext;
import graphql.execution.instrumentation.InstrumentationState;
import graphql.execution.instrumentation.SimpleInstrumentation;
import graphql.execution.instrumentation.parameters.InstrumentationExecutionParameters;
import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters;
import graphql.schema.GraphQLFieldDefinition;
export default undefined;
type Container<T> = {
consume: (arg: T) => void;
};
// string ist super-type von "hello" 😳
// Entspricht in C# sowas hier:
// public class Event { } // => string
// public class MouseEvent : Event { } // => "hello"
type StringType = string;
async function loadArticle(articleId) { /* ... */ }
async function loadComments(articleId) { /* ... */ }
async function Page( {articleId} ) {
// Beide Requests starten parallel
const articlePromise = loadArticle(articleId);
const commentsPromise = loadComments(articleId);
return <React.Suspense fallback={<h1>Please wait, data is loading</h1>}>
@nilshartmann
nilshartmann / react19-training.md
Created March 19, 2025 05:26
React Training technische Voraussetzungen

Preparations for React Training

During the workshop, we will complete exercises. To participate, you need to install some necessary tools (if you haven't already).

You can use this guide to check, if your setup works before the workshop. This ensures you have time to resolve any issues, especially if your computer has security restrictions or you lack full administrative access.

Requirements

For Your Laptop/PC

@nilshartmann
nilshartmann / hover-link-tooltip.js
Last active May 3, 2025 13:54
"Tooltip" on hover+Cmd on an Link/a-Element on a website