Skip to content

Commit 0e26883

Browse files
committed
Progress
1 parent d4c193a commit 0e26883

File tree

74 files changed

+1575
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1575
-461
lines changed
102 KB
Loading
66.8 KB
Loading
9.49 KB
Loading

.github/static/inspections.png

9.52 KB
Loading
36.4 KB
Loading

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ This plugin adds support for [Spring GraphQL](https://spring.io/projects/spring-
1111

1212
Features:
1313
- Autocompletion of types and fields in @SchemaMapping annotations
14+
- Navigation between mappings and the schema
15+
- Checks for @BatchMapping return type
16+
- Data loader view
1417
<!-- Plugin description end -->
1518

1619
## Installation
@@ -24,3 +27,33 @@ Features:
2427

2528
Download the [latest release](https://github.com/jord1e/spring-graphql-intellij-plugin/releases/latest) and install it manually using
2629
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from disk...</kbd>
30+
31+
## Screenshots
32+
33+
### Type Autocompletion
34+
35+
![Type Autocompletion](./.github/static/autoCompleteTypes.png)
36+
37+
### Field Autocompletion
38+
39+
![Field Autocompletion](./.github/static/autoCompleteFields.png)
40+
41+
### Navigate between types
42+
43+
![Navigate between types](./.github/static/navigateBetweenTypes.png)
44+
45+
### Data Fetchers in your project view
46+
47+
![Project view](./.github/static/fetchersInProjectView.png)
48+
49+
### More inspections
50+
51+
![Project view](./.github/static/inspections.png)
52+
53+
## Attribution
54+
55+
Much of the initial development was inspired by the [DGS plugin](https://github.com/Netflix/dgs-intellij-plugin).
56+
57+
This plugin reuses `apollo.svg`, `apollo_dark.svg`, `query.svg`, and `fragment.svg` icons from the [GraphQL plugin](https://github.com/jimkyndemeyer/js-graphql-intellij-plugin) (MIT).
58+
59+
This plugin uses (modified) [JetBrains icons](https://jetbrains.design/intellij/resources/icons_list/) (predominantly Apache 2.0).

build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ plugins {
2525
id("org.jetbrains.intellij") version "1.3.0"
2626
id("org.jetbrains.changelog") version "1.3.1"
2727
id("org.jetbrains.qodana") version "0.1.13"
28+
id("com.diffplug.spotless") version "6.1.0"
2829
}
2930

3031
group = properties("pluginGroup")
@@ -34,6 +35,12 @@ repositories {
3435
mavenCentral()
3536
}
3637

38+
spotless {
39+
kotlin {
40+
ktlint("0.43.2")
41+
}
42+
}
43+
3744
// https://github.com/JetBrains/gradle-intellij-plugin
3845
intellij {
3946
pluginName.set(properties("pluginName"))
File renamed without changes.

src/main/java/nl/jrdie/idea/springql/svc/QLIdeService.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
package nl.jrdie.idea.springql.svc;
22

3+
import com.intellij.lang.jsgraphql.types.language.Node;
34
import com.intellij.openapi.project.Project;
45
import nl.jrdie.idea.springql.index.QLIdeIndex;
6+
import nl.jrdie.idea.springql.types.SchemaMappingSummary;
57
import org.jetbrains.annotations.NotNull;
8+
import org.jetbrains.annotations.Nullable;
69
import org.jetbrains.uast.UAnnotation;
10+
import org.jetbrains.uast.UClass;
11+
import org.jetbrains.uast.UElement;
712
import org.jetbrains.uast.UMethod;
813

14+
import java.util.List;
15+
916
public interface QLIdeService {
1017

1118
@NotNull
@@ -26,6 +33,29 @@ default QLIdeIndex getIndex() {
2633

2734
boolean isMethodUsed(UMethod uMethod);
2835

36+
boolean needsControllerAnnotation(@NotNull UClass uClass);
37+
38+
boolean isIntrospectionNode(Node<?> node);
39+
40+
boolean isApolloFederationSupportEnabled();
41+
42+
@Nullable
43+
SchemaMappingSummary getSummaryForMethod(@NotNull UMethod uMethod);
44+
45+
default boolean isApolloFederationNode(Node<?> node, boolean checkSupport) {
46+
if (checkSupport && !isApolloFederationSupportEnabled()) {
47+
return false;
48+
}
49+
return isApolloFederationNode(node);
50+
}
51+
52+
boolean isApolloFederationNode(Node<?> node);
53+
54+
@Nullable
55+
String findApplicableParentTypeName(@NotNull UAnnotation uAnnotation);
56+
57+
List<UAnnotation> findNearestSchemaMappingAnnotations(UElement uElement);
58+
2959
@NotNull
3060
QLSchemaRegistry getSchemaRegistry();
3161

0 commit comments

Comments
 (0)