CONFLICT – 永夜 https://www.shuijingwanwq.com 没有不值得去解决的问题,也没有不值得去学习的技术! Sun, 24 May 2026 10:38:15 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0 在 GraphQL API 响应报错:Fields “default” conflict because they return conflicting types Float! and Boolean!. Use different aliases on the fields to fetch both if this was intentional. https://www.shuijingwanwq.com/2022/08/10/6856/ https://www.shuijingwanwq.com/2022/08/10/6856/#respond Wed, 10 Aug 2022 01:18:20 +0000 https://www.shuijingwanwq.com/?p=6856 浏览量: 105 1、在 GraphQL API 响应报错:Fields “default” conflict because they return conflicting types Float! and Boolean!. Use different aliases on the fields to fetch both if this was intentional.


{
  "errors": [
    {
      "message": "Fields \"default\" conflict because they return conflicting types Float! and Boolean!. Use different aliases on the fields to fetch both if this was intentional.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 134,
          "column": 3
        },
        {
          "line": 145,
          "column": 3
        }
      ]
    },
    {
      "message": "Fields \"value\" conflict because they return conflicting types Float! and Boolean!. Use different aliases on the fields to fetch both if this was intentional.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 139,
          "column": 3
        },
        {
          "line": 146,
          "column": 3
        }
      ]
    }
  ]
}


2、查看查询请求,发现有相应提示:Fields “default” conflict because they return conflicting types “Float!” and “Boolean!”. Use different aliases on the fields to fetch both if this was intentional.。如图1
查看查询请求,发现有相应提示:Fields "default" conflict because they return conflicting types "Float!" and "Boolean!". Use different aliases on the fields to fetch both if this was intentional.

图1



query OnlineStoreTheme($themeId: ID!) {
  onlineStoreTheme(themeId: $themeId) {
    themeSettingsCategories {
      ...ThemeSettingsCategory
      __typename
    }
    __typename
  }
}

fragment ThemePreset on ThemePreset {
  id
  settings {
    ...ThemeStyleSetting
  }
  sections {
    id
    sectionId
    disabled
    schema {
      blockSchemas {
        id
        limit
        name
        settings {
          id
          info
          label
          settingId
          type
        }
        type
      }
    }
  }
}

fragment ThemeStyleSetting on ThemeStyleSetting {
  id
  settingId
  value
  type
}

fragment ThemeSettingsCategory on ThemeSettingsCategory {
  id
  title
  settings {
    ...ThemeSetting
    __typename
  }
  __typename
}

fragment ThemeSetting on ThemeSetting {
  ... on ThemeSettingRange {
    ...ThemeSettingRange
    __typename
  }
  ... on ThemeSettingCheckbox {
    ...ThemeSettingCheckbox
    __typename
  }
  __typename
}

fragment ThemeSettingCommon on ThemeSetting {
  id
  info
  label
  settingId
  type
  __typename
}

fragment ThemeSettingRange on ThemeSettingRange {
  ...ThemeSettingCommon
  default
  min
  max
  step
  unit
  value
  __typename
}

fragment ThemeSettingCheckbox on ThemeSettingCheckbox {
  ...ThemeSettingCommon
  default
  value
  __typename
}



3、原因应该在于此接口类型的实现中,字段类型不一样,查询时使用了内联片段。在 ThemeSettingRange 中为 Float!。在 ThemeSettingCheckbox 中为 Boolean!。如果您在同一选择集中多次请求具有相同名称(或别名)的字段,则该字段必须返回相同的类型。如图2、图3
此接口类型的实现中,字段类型不一样,查询时使用了内联片段。在 ThemeSettingRange 中为 Float!。

图2

 
此接口类型的实现中,字段类型不一样,查询时使用了内联片段。在 ThemeSettingCheckbox 中为 Boolean!

图3



type ThemeSettingRange implements ThemeSetting
{

    default: Float!

    value: Float!
}

type ThemeSettingCheckbox implements ThemeSetting
{

    default: Boolean!


    value: Boolean!
}


4、参考:https://github.com/graphql/graphql-js/issues/1361 ,使用别名可以解决此问题。但是使用别名,会增加客户端的解析难度。如图4
参考:https://github.com/graphql/graphql-js/issues/1361 ,使用别名可以解决此问题。但是使用别名,会增加客户端的解析难度。

图4



fragment ThemeSettingRange on ThemeSettingRange {
  ...ThemeSettingCommon
  rangeDefault: default
  min
  max
  step
  unit
  rangeValue: value
  __typename
}




{
  "id": "96b1c8b9-5b18-4760-9e26-50ab009ac011/settings/radius__image",
  "info": null,
  "label": "图片圆角度数",
  "settingId": "radius__image",
  "type": "RANGE",
  "__typename": "ThemeSettingRange",
  "rangeDefault": 0,
  "min": 0,
  "max": 24,
  "step": 1,
  "unit": null,
  "rangeValue": 0
}


   ]]>
https://www.shuijingwanwq.com/2022/08/10/6856/feed/ 0
在 命令行中 Git cherry-pick 的使用 https://www.shuijingwanwq.com/2022/06/14/6602/ https://www.shuijingwanwq.com/2022/06/14/6602/#respond Tue, 14 Jun 2022 01:15:59 +0000 https://www.shuijingwanwq.com/?p=6602 浏览量: 127

1、现在需要将分支 A 上的一些提交应用至分支 B 上。

2、先切换至分支:B 上,执行命令:git cherry-pick fbf19e86。报错:CONFLICT (content): Merge conflict in platform/app/Services/ThemeService.php . error: could not apply fbf19e86f4… 。如图1

先切换至分支:B 上,执行命令:git cherry-pick fbf19e86。报错:CONFLICT (content): Merge conflict in platform/app/Services/ThemeService.php . error: could not apply fbf19e86f4... 。

图1


Auto-merging platform/app/Services/ThemeService.php
CONFLICT (content): Merge conflict in platform/app/Services/ThemeService.php
error: could not apply fbf19e86f4... 安装 2.0 主题模式下的主题。对接 SaaS 中心完成。
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
PS E:\wwwroot\object> git cherry-pick --abort


3、原因找到,原因是提交 ID fbf19e86 之前还有一些提交,不应该跳过去。如图2

原因找到,原因是提交 ID fbf19e86 之前还有一些提交,不应该跳过去

图2

4、执行命令:git cherry-pick –abort,发生代码冲突后,放弃合并,回到操作前的样子。


PS E:\wwwroot\object> git cherry-pick --abort
PS E:\wwwroot\object>


5、执行命令:git cherry-pick 5b0afab6。不再报错。因为这个提交是分支 B 上的我的下一次提交。如图3

执行命令:git cherry-pick 5b0afab6。不再报错。因为这个提交是分支 B 上的我的下一次提交

图3


PS E:\wwwroot\object> git cherry-pick 5b0afab6
Auto-merging platform/app/Services/ThemeService.php
[feature/theme-store-wangqiang-20220526 531899fd34] 获取 SaaS 主题配置,重新索引多维数组的重构
 Date: Tue May 10 15:56:06 2022 +0800
 1 file changed, 1 insertion(+), 1 deletion(-)


6、按提交 ID 时间顺序依次执行第 5 步骤,由于一些提交ID是连续提交。如图4

按提交 ID 时间顺序依次执行第 5 步骤,由于一些提交ID是连续提交

图4

7、可以使用下面的简便语法。存在冲突。解决代码冲突后,第一步将修改的文件重新加入暂存区(git add .),第二步使用下面的命令,让 Cherry pick 过程继续执行。期间使用 vim 编辑器(直接退出),我是在 PhpStorm 中编辑的。如图5

可以使用下面的简便语法。存在冲突。解决代码冲突后,第一步将修改的文件重新加入暂存区(git add .),第二步使用下面的命令,让 Cherry pick 过程继续执行。期间使用 vim 编辑器(直接退出),我是在 PhpStorm 中编辑的

图5


Auto-merging platform/app/Http/Controllers/API/StatisticsController.php
CONFLICT (content): Merge conflict in platform/app/Http/Controllers/API/StatisticsController.php
Auto-merging platform/app/Http/Kernel.php
当前主题中间件替换为:CurrentTheme

# Conflicts:
#       platform/app/Http/Controllers/API/StatisticsController.php
#
# It looks like you may be committing a cherry-pick.
# If this is not correct, please run
#       git update-ref -d CHERRY_PICK_HEAD
# and try again.


# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Tue May 10 17:55:23 2022 +0800
#
# On branch feature/theme-store-wangqiang-20220526
# Your branch is ahead of 'origin/feature/theme-store-wangqiang-20220526' by 1 commit.
#   (use "git push" to publish your local commits)
#
# Cherry-pick currently in progress.
#
# Changes to be committed:
#       modified:   platform/app/Http/Controllers/API/StatisticsController.php
#       modified:   platform/app/Http/Kernel.php
E:/wwwroot/object/.git/COMMIT_EDITMSG [unix] (18:56 26/05/2022)             2,0-1 Top

[feature/theme-store-wangqiang-20220526 9766f26582] 当前主题中间件替换为:CurrentTheme
 Date: Tue May 10 17:55:23 2022 +0800
 5 files changed, 109 insertions(+), 166 deletions(-)
 delete mode 100644 platform/app/Http/Middleware/ConfigTheme.php
 rewrite platform/app/Http/Middleware/CurrentTheme.php (78%)
Auto-merging platform/app/Services/ThemeService.php
[feature/theme-store-wangqiang-20220526 25cf0e2a8a] 安装主题,入库实现


8、查看提交日志,符合预期。选择的提交ID皆已纳入分支 B 中。如图6

查看提交日志,符合预期。选择的提交ID皆已纳入分支 B 中

图6

9、如果提示:The previous cherry-pick is now empty, possibly due to conflict resolution.。则执行命令:git cherry-pick –skip。


PS E:\wwwroot\object> git cherry-pick --continue
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:

    git commit --allow-empty

Otherwise, please use 'git cherry-pick --skip'
On branch feature/theme-store-wangqiang-202205262
Your branch is up to date with 'origin/feature/theme-store-wangqiang-202205262'.

Cherry-pick currently in progress.
  (run "git cherry-pick --continue" to continue)
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

nothing to commit, working tree clean


 

]]>
https://www.shuijingwanwq.com/2022/06/14/6602/feed/ 0
在 TortoiseGit 中使用变基操作 https://www.shuijingwanwq.com/2022/03/04/6074/ https://www.shuijingwanwq.com/2022/03/04/6074/#respond Fri, 04 Mar 2022 01:29:43 +0000 https://www.shuijingwanwq.com/?p=6074 浏览量: 245 1、执行命令:git pull origin feature/theme-store –rebase,使用变基操作


PS E:\wwwroot\object> git pull origin feature/theme-store --rebase
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.


2、运行 git stash push,贮藏修改。


PS E:\wwwroot\object> git stash push
Saved working directory and index state WIP on theme-store-wangqiang-20220215: dcbbe12be Add default section content_for_layout to render section settings
PS E:\wwwroot\object>


3、再次执行变基命令


PS E:\wwwroot\object> git pull origin feature/theme-store --rebase
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 28 (delta 3), reused 2 (delta 2), pack-reused 12
Unpacking objects: 100% (28/28), 93.32 KiB | 54.00 KiB/s, done.
From https://xxx.com/xxx/object
 * branch                feature/theme-store -> FETCH_HEAD
   dcbbe12be..f6709bcf5  feature/theme-store -> origin/feature/theme-store
Updating dcbbe12be..f6709bcf5
Fast-forward
 .../json_schema/types/color_background.json        |   12 +
 .../Accessor/DelayedThemeSettingAccessor.php       |   21 +-
 .../ThemeSetting/Schema/SettingTypeFactory.php     |    1 +
 .../Schema/Types/ColorBackgroundType.php           |    9 +
 .../Modules/ThemeSetting/View/ManagesTemplate.php  |    5 +-
 platform/composer.json                             |   15 +-
 platform/composer.lock                             | 4901 ++++++++++++++++----
 7 files changed, 4150 insertions(+), 814 deletions(-)
 create mode 100644 platform/Modules/ThemeSetting/Resources/json_schema/types/color_background.json
 create mode 100644 platform/Modules/ThemeSetting/Schema/Types/ColorBackgroundType.php
PS E:\wwwroot\object>


4、运行 git stash pop 来应用贮藏然后立即从栈上扔掉它。合并代码出现冲突。
<pre class="wp-block-syntaxhighlighter-code">

PS E:\wwwroot\object> git stash pop
Auto-merging platform/composer.lock
CONFLICT (content): Merge conflict in platform/composer.lock
Auto-merging platform/composer.json
CONFLICT (content): Merge conflict in platform/composer.json
The stash entry is kept in case you need it again.
PS E:\wwwroot\object> git status
On branch feature/theme-store-wangqiang-20220215
Your branch is ahead of 'origin/feature/theme-store-wangqiang-20220215' by 3 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   platform/.rnd
        modified:   platform/app/Http/Kernel.php
        modified:   platform/app/Http/Middleware/CurrentTheme.php
        modified:   platform/app/Providers/AppServiceProvider.php
        modified:   platform/app/Services/PluginService.php
        modified:   platform/config/app.php
        modified:   platform/config/modules.php
        modified:   platform/phpunit.xml

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
        both modified:   platform/composer.json
        both modified:   platform/composer.lock

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        platform/composer.json.BASE.json
        platform/composer.json.LOCAL.json
        platform/composer.json.REMOTE.json

PS E:\wwwroot\object>

</pre>
5、在 TortoiseGit 中,Git 提交,存在冲突文件:platform/composer.json、platform/composer.lock。如图1
在 TortoiseGit 中,Git 提交,存在冲突文件:platform/composer.json、platform/composer.lock。

图1

6、右键存在冲突文件,使用”HEAD”解决冲突。如图2
右键存在冲突文件,使用"HEAD"解决冲突

图2

7、确定要将已冲突的文件标记为已解决吗?直接点击是按钮。如图3
确定要将已冲突的文件标记为已解决吗?直接点击是按钮

图3

8、运行 git status,可以看到已经不存在冲突
<pre class="wp-block-syntaxhighlighter-code">

PS E:\wwwroot\object> git status
On branch feature/theme-store-wangqiang-20220215
Your branch is ahead of 'origin/feature/theme-store-wangqiang-20220215' by 3 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   platform/.rnd
        modified:   platform/app/Http/Kernel.php
        modified:   platform/app/Http/Middleware/CurrentTheme.php
        modified:   platform/app/Providers/AppServiceProvider.php
        modified:   platform/app/Services/PluginService.php
        modified:   platform/config/app.php
        modified:   platform/config/modules.php
        modified:   platform/phpunit.xml

PS E:\wwwroot\object>

</pre>
9、查看 Git 日志,变基操作已经完成。
<pre class="wp-block-syntaxhighlighter-code">

PS E:\wwwroot\object> git log
commit f6709bcf51c8b95bba96f241ae369ed58d7ca585 (HEAD -> feature/theme-store-wangqiang-20220215, origin/feature/theme-store)
Author: Vidy Videni <vidy.videni@gmail.com>
Date:   Thu Feb 17 09:21:26 2022 +0800

    Add color background type

commit 7cf1c1f9ac44eec2fddd2ed67984bc41d3062409
Author: Vidy Videni <vidy.videni@gmail.com>
Date:   Tue Feb 15 16:43:21 2022 +0800

    Install orchestra asset packages

commit a55b3dec62c63305476af07fc46fe82554e13a87
Author: Vidy Videni <vidy.videni@gmail.com>
Date:   Tue Feb 15 15:51:40 2022 +0800

    Allow empty for ThemeSettingAccessor

commit dcbbe12be67a4defccfd444d45ba4eb67a363112 (origin/feature/theme-store-wangqiang-20220215, feature/theme-store)
Author: Vidy Videni <vidy.videni@gmail.com>
Date:   Tue Feb 15 14:44:07 2022 +0800

    Add default section content_for_layout to render section settings

commit a017d01d10273043ed31673e0630196ff7ae65ca
PS E:\wwwroot\object>

</pre>
10、现在需要在 TortoiseGit 中实现第 2 – 4 步骤的相应操作。第2、4步骤可参考:在 TortoiseGit 中使用 stash 操作 11、主要是第 3 步骤,第 2 步骤执行完毕后,重新拉取代码,主要是获取上游分支的更新,在 TortoiseGit 中,TortoiseGit – 变基(rebase)。分支为当前本地分支,上游为远程分支。如图4
主要是第 3 步骤,第 2 步骤执行完毕后,重新拉取代码,主要是获取上游分支的更新,在 TortoiseGit 中,TortoiseGit - 变基(rebase)。分支为当前本地分支,上游为远程分支

图4



git.exe checkout -f 1150e89205303e353ae0aab7cfcf045c2255b515 --
开始变基

选取 1: c9ea3f15ae0cfb4fa863053d9a30d8da6a7bcb71
feat: 在 获取主题基本信息 接口中,添加字段:themeAsset(获取主题素材的内容)
[detached HEAD 38666ec8d] feat: 在 获取主题基本信息 接口中,添加字段:themeAsset(获取主题素材的内容)
 Date: Thu Feb 17 11:28:20 2022 +0800
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 platform/Modules/ThemeStore/Resolver/OnlineStoreTheme/ThemeAssetResolver.php

选取 2: 956b4341cd65d641bc35368c0a1f693d2083dc21
perf: 主题素材的路径,反斜杠转换为正斜杠
[detached HEAD 04a85bfe1] perf: 主题素材的路径,反斜杠转换为正斜杠
 Date: Thu Feb 17 11:35:16 2022 +0800
 1 file changed, 16 insertions(+), 14 deletions(-)

选取 3: 85092d26901b1a731a888448168fc40a17ea75c2
test: 在 获取主题基本信息 接口中,针对字段:themeAsset(获取主题素材的内容)。编写测试
[detached HEAD 0eb9bf7b9] test: 在 获取主题基本信息 接口中,针对字段:themeAsset(获取主题素材的内容)。编写测试
 Date: Thu Feb 17 15:42:07 2022 +0800
 1 file changed, 31 insertions(+)

git.exe checkout -f -B feature/theme-store-wangqiang-20220215 0eb9bf7b994a73a739aff787da3f2ffcad193c3c --
git.exe reset --hard 0eb9bf7b994a73a739aff787da3f2ffcad193c3c --



12、查看日志,符合预期。如图5
查看日志,符合预期

图5

13、如果在变基时,需要保留 2 个分支的代码,则需要解决冲突后,再提交。如图6
如果在变基时,需要保留 2 个分支的代码,则需要解决冲突后,再提交

图6

14、确定要将有冲突的文件标识为已解决吗?是。如图7
确定要将有冲突的文件标识为已解决吗?是。

图7

15、再点击提交按钮。如图8
再点击提交按钮

图8

16、当前提交将是空的 (例如,由于解决冲突)。跳过此提交或者只保留提交消息?选择提交。如图9
当前提交将是空的 (例如,由于解决冲突)。跳过此提交或者只保留提交消息?选择提交

图9

17、变基完成。如图10
变基完成

图10

]]>
https://www.shuijingwanwq.com/2022/03/04/6074/feed/ 0
基于 TortoiseGit ,单向合并 feature-netease 分支上的单次提交(ee8290)至 develop 分支上的流程 https://www.shuijingwanwq.com/2019/09/02/3490/ https://www.shuijingwanwq.com/2019/09/02/3490/#respond Mon, 02 Sep 2019 09:28:09 +0000 http://www.shuijingwanwq.com/?p=3490 浏览量: 125

1、在本地环境中的 develop 分支上,执行控制台命令报错:如图1

在本地环境中的 develop 分支上,执行控制台命令报错:

图1

2、由于此 Bug 已经在 feature-netease 分支上的单次提交(ee8290)中被修复,如图2

3、因此,决定基于 TortoiseGit ,单向合并 feature-netease 分支上的单次提交(ee8290)至 develop 分支上

4、在 GitLab 上查看 develop 分支上的提交,如图3

在 GitLab 上查看 develop 分支上的提交

图3

5、在 GitLab 上查看 feature-netease 分支上的提交,如图4

在 GitLab 上查看 feature-netease 分支上的提交

图4

6、在本地仓库,切换至 develop 分支,右键,TortoiseGit -> 合并,如图5

在本地仓库,切换至 develop 分支,右键,TortoiseGit -> 合并

图5

7、选择提交,点击浏览按钮,如图6

选择提交,点击浏览按钮

图6

8、勾选全部分支,选择单次提交(ee8290),右键,摘取此提交,如图7

勾选全部分支,选择单次提交(ee8290),右键,摘取此提交

图7

9、在弹出的摘取提示框中,点击选中提交(ee8290),点击继续,如图8

在弹出的摘取提示框中,点击选中提交(ee8290),点击继续

图8

10、存在冲突,需要手动解决冲突后,标记为已解决,如图9、图10

存在冲突,需要手动解决冲突

图9

标记为已解决

图10

11、在弹出的摘取提示框中,点击提交,如图11

在弹出的摘取提示框中,点击提交

图11

12、在弹出的摘取提示框中,点击完成,如图12

在弹出的摘取提示框中,点击完成

图12

13、右键,TortoiseGit -> 推送,推送成功,如图13

右键,TortoiseGit -> 推送,推送成功

图13

14、在 GitLab 上查看 develop 分支上的提交,提交(ee8290)已经合并至 develop 分支,如图14

在 GitLab 上查看 develop 分支上的提交,提交(ee8290)已经合并至 develop 分支

图14

15、在 GitLab 上查看 feature-netease 分支上的提交,无变化,符合预期,如图15

在 GitLab 上查看 feature-netease 分支上的提交,无变化,符合预期

图15

16、在本地环境中的 develop 分支上,执行控制台命令成功,如图16

在本地环境中的 develop 分支上,执行控制台命令成功

图16

 

]]>
https://www.shuijingwanwq.com/2019/09/02/3490/feed/ 0