Skip to content

Commit

Permalink
[eas-cli] require id field rule
Browse files Browse the repository at this point in the history
  • Loading branch information
quinlanj committed Jan 11, 2021
1 parent a87b735 commit 1d12940
Show file tree
Hide file tree
Showing 22 changed files with 64 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/eas-cli/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ module.exports = {
schemaJson: require('./graphql.schema.json'),
},
],
'graphql/required-fields': [
'error',
{
env: 'apollo',
schemaJson: require('./graphql.schema.json'),
requiredFields: ['id'],
},
],
},
plugins: ['graphql'],
};
2 changes: 2 additions & 0 deletions packages/eas-cli/src/commands/release/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ export default class ReleaseList extends Command {
id
releaseName
updates(offset: 0, limit: 1) {
id
actor {
__typename
id
... on User {
username
}
Expand Down
3 changes: 3 additions & 0 deletions packages/eas-cli/src/commands/release/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ async function viewUpdateReleaseAsync({
query ViewRelease($appId: String!, $releaseName: String!, $limit: Int!) {
app {
byId(appId: $appId) {
id
updateReleaseByReleaseName(releaseName: $releaseName) {
id
releaseName
updates(offset: 0, limit: $limit) {
id
updateGroup
updateMessage
createdAt
actor {
id
... on User {
firstName
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const AppleAppIdentifierMutation = {
appleAppIdentifierInput: $appleAppIdentifierInput
accountId: $accountId
) {
id
...AppleAppIdentifierFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const AppleDeviceMutation = {
mutation AppleDeviceMutation($appleDeviceInput: AppleDeviceInput!, $accountId: ID!) {
appleDevice {
createAppleDevice(appleDeviceInput: $appleDeviceInput, accountId: $accountId) {
id
...AppleDeviceFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const AppleDeviceRegistrationRequestMutation = {
appleTeamId: $appleTeamId
accountId: $accountId
) {
id
...AppleDeviceRegistrationRequestFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ const AppleDistributionCertificateMutation = {
appleDistributionCertificateInput: $appleDistributionCertificateInput
accountId: $accountId
) {
id
...AppleDistributionCertificateFragment
appleTeam {
id
...AppleTeamFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ const AppleProvisioningProfileMutation = {
accountId: $accountId
appleAppIdentifierId: $appleAppIdentifierId
) {
id
...AppleProvisioningProfileFragment
appleTeam {
id
...AppleTeamFragment
}
}
Expand Down Expand Up @@ -74,8 +76,10 @@ const AppleProvisioningProfileMutation = {
id: $appleProvisioningProfileId
appleProvisioningProfileInput: $appleProvisioningProfileInput
) {
id
...AppleProvisioningProfileFragment
appleTeam {
id
...AppleTeamFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const AppleTeamMutation = {
mutation AppleTeamMutation($appleTeamInput: AppleTeamInput!, $accountId: ID!) {
appleTeam {
createAppleTeam(appleTeamInput: $appleTeamInput, accountId: $accountId) {
id
...AppleTeamFragment
account {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const IosAppBuildCredentialsMutation = {
iosAppBuildCredentialsInput: $iosAppBuildCredentialsInput
iosAppCredentialsId: $iosAppCredentialsId
) {
id
...IosAppBuildCredentialsFragment
}
}
Expand Down Expand Up @@ -63,6 +64,7 @@ const IosAppBuildCredentialsMutation = {
id: $iosAppBuildCredentialsId
distributionCertificateId: $distributionCertificateId
) {
id
...IosAppBuildCredentialsFragment
}
}
Expand Down Expand Up @@ -97,6 +99,7 @@ const IosAppBuildCredentialsMutation = {
id: $iosAppBuildCredentialsId
provisioningProfileId: $provisioningProfileId
) {
id
...IosAppBuildCredentialsFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const IosAppCredentialsMutation = {
appId: $appId
appleAppIdentifierId: $appleAppIdentifierId
) {
id
...IosAppCredentialsFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const AppQuery = {
query AppByFullNameQuery($fullName: String!) {
app {
byFullName(fullName: $fullName) {
id
...AppFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const AppleAppIdentifierQuery = {
) {
account {
byName(accountName: $accountName) {
id
appleAppIdentifiers(bundleIdentifier: $bundleIdentifier) {
id
...AppleAppIdentifierFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ const AppleDeviceQuery = {
query AppleDevicesByAppleTeamQuery($accountId: ID!, $appleTeamIdentifier: String!) {
appleTeam {
byAppleTeamIdentifier(accountId: $accountId, identifier: $appleTeamIdentifier) {
id
...AppleTeamFragment
appleDevices {
id
...AppleDeviceFragment
appleTeam {
id
...AppleTeamFragment
}
}
Expand Down Expand Up @@ -74,6 +77,7 @@ const AppleDeviceQuery = {
) {
account {
byName(accountName: $accountName) {
id
appleTeams(appleTeamIdentifier: $appleTeamIdentifier) {
id
appleTeamIdentifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,18 @@ const AppleDistributionCertificateQuery = {
) {
app {
byFullName(fullName: $projectFullName) {
id
iosAppCredentials(filter: { appleAppIdentifierId: $appleAppIdentifierId }) {
id
iosAppBuildCredentialsArray(
filter: { iosDistributionType: $iosDistributionType }
) {
id
distributionCertificate {
id
...AppleDistributionCertificateFragment
appleTeam {
id
...AppleTeamFragment
}
}
Expand Down Expand Up @@ -86,9 +91,12 @@ const AppleDistributionCertificateQuery = {
query AppleDistributionCertificateByAccountQuery($accountName: String!) {
account {
byName(accountName: $accountName) {
id
appleDistributionCertificates {
id
...AppleDistributionCertificateFragment
appleTeam {
id
...AppleTeamFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,26 @@ const AppleProvisioningProfileQuery = {
) {
app {
byFullName(fullName: $projectFullName) {
id
iosAppCredentials(filter: { appleAppIdentifierId: $appleAppIdentifierId }) {
id
iosAppBuildCredentialsArray(
filter: { iosDistributionType: $iosDistributionType }
) {
id
provisioningProfile {
id
...AppleProvisioningProfileFragment
appleTeam {
id
...AppleTeamFragment
}
appleDevices {
id
...AppleDeviceFragment
}
appleAppIdentifier {
id
...AppleAppIdentifierFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const AppleTeamQuery = {
query AppleTeamsByAccountName($accountName: String!) {
account {
byName(accountName: $accountName) {
id
appleTeams {
id
appleTeamName
Expand Down Expand Up @@ -44,6 +45,7 @@ const AppleTeamQuery = {
query AppleTeamByIdentifierQuery($accountId: ID!, $appleTeamIdentifier: String!) {
appleTeam {
byAppleTeamIdentifier(accountId: $accountId, identifier: $appleTeamIdentifier) {
id
...AppleTeamFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ const IosAppBuildCredentialsQuery = {
) {
app {
byFullName(fullName: $projectFullName) {
id
iosAppCredentials(filter: { appleAppIdentifierId: $appleAppIdentifierId }) {
id
iosAppBuildCredentialsArray(
filter: { iosDistributionType: $iosDistributionType }
) {
id
...IosAppBuildCredentialsFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const IosAppCredentialsQuery = {
) {
app {
byFullName(fullName: $projectFullName) {
id
iosAppCredentials(filter: { appleAppIdentifierId: $appleAppIdentifierId }) {
id
...IosAppCredentialsFragment
}
}
Expand Down Expand Up @@ -62,11 +64,14 @@ const IosAppCredentialsQuery = {
) {
app {
byFullName(fullName: $projectFullName) {
id
iosAppCredentials(filter: { appleAppIdentifierId: $appleAppIdentifierId }) {
id
...IosAppCredentialsFragment
iosAppBuildCredentialsArray(
filter: { iosDistributionType: $iosDistributionType }
) {
id
...IosAppBuildCredentialsFragment
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/eas-cli/src/graphql/mutations/PublishMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const PublishMutation = {
mutation PublishMutation($publishUpdateGroupInput: PublishUpdateGroupInput) {
updateRelease {
publishUpdateGroup(publishUpdateGroupInput: $publishUpdateGroupInput) {
id
updateGroup
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/eas-cli/src/graphql/queries/BuildQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const BuildQuery = {
query BuildsByIdQuery($buildId: ID!) {
builds {
byId(buildId: $buildId) {
id
platform
artifacts {
buildUrl
Expand Down Expand Up @@ -56,6 +57,7 @@ const BuildQuery = {
platform: $platform
status: $status
) {
id
platform
artifacts {
buildUrl
Expand Down Expand Up @@ -93,6 +95,7 @@ const BuildQuery = {
) {
account {
byName(accountName: $accountName) {
id
inQueueBuilds: builds(
offset: 0
limit: 1
Expand Down
1 change: 1 addition & 0 deletions packages/eas-cli/src/project/projectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export async function getReleaseByNameAsync({
query ViewRelease($appId: String!, $releaseName: String!) {
app {
byId(appId: $appId) {
id
updateReleaseByReleaseName(releaseName: $releaseName) {
id
releaseName
Expand Down

0 comments on commit 1d12940

Please sign in to comment.